using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows.Forms;
using ICP_MS.Plugin.Experiment.Properties;
using Microsoft.Office.Interop.Excel;

namespace ICP_MS.Plugin.Experiment;

public class FormNumerics : Form
{
	private ExperimentDatas experiment = null;

	private ExperimentDB db = null;

	private DataTable dtConcentration = new DataTable();

	private DataTable dtConcentrationSingle = new DataTable();

	private DataTable dtUncorrectCPSSingle = new DataTable();

	private DataTable dtUncorrectedICPS = new DataTable();

	private DataTable dtAnalyteICPS = new DataTable();

	private DataTable dtAnalyteICPSSingle = new DataTable();

	private DataTable dtRatio = new DataTable();

	private DataTable dtRatioSingle = new DataTable();

	private bool concLoad = false;

	private bool uncpsLoad = false;

	private bool cpsLoad = false;

	private volatile bool isInRefresh = false;

	private List<Point> ptExclude = new List<Point>();

	private List<List<int>> ptExclude1 = new List<List<int>>();

	private Color rsdOutColor = Color.LightCyan;

	private FormExport formExport;

	private IContainer components = null;

	private TabControl tabNumeric;

	private TabPage pageAnalyteConcentration;

	private TabPage pageUncorrectICPS;

	private TabPage pageAnalyteICPS;

	private TabPage pageRatio;

	private ToolStrip toolStrip1;

	private ToolStripButton tsbtnRefresh;

	private ToolStripSeparator toolStripSeparator1;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;

	private RowMergeView dgvUncorrectedICPS;

	private RowMergeView dgvAnalyteICPS;

	private RowMergeView dgvAnalyteConcentrations;

	private RowMergeView dgvRatio;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;

	private ToolStripSplitButton tsbtnSaveResult;

	private ToolStripMenuItem tsmiUCPS;

	private ToolStripMenuItem tsmiCPS;

	private ToolStripMenuItem tsmiCONC;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;

	private ToolStripButton tsbtnDatas;

	private ToolStripComboBox toolStripComboBoxPA;

	private ToolStripButton toolStripButtonExport;

	private RowMergeView dataGridView1;

	private RowMergeView rowMergeView1;

	private RowMergeView rowMergeView2;

	private Panel panel2;

	private Panel panel1;

	private Panel panel4;

	private Panel panel3;

	private Panel panel6;

	private Panel panel5;

	private Panel panel8;

	private Panel panel7;

	private RowMergeView rowMergeView3;

	public event EventHandler SaveDBEvent = null;

	public FormNumerics()
	{
		InitializeComponent();
	}

	public void SetParams(ExperimentDatas experiment, ExperimentDB db)
	{
		this.experiment = experiment;
		this.db = db;
	}

	public void UpdateSelectedIsotopes(object sender, EventArgs e)
	{
	}

	public void UpdateInternalStandards(object sender, EventArgs e)
	{
	}

	public void UpdateSamples(object sender, EventArgs e)
	{
		RefreshResults();
	}

	private void InitConcentration1()
	{
		int firstRow = ((DataGridView)(object)dgvAnalyteConcentrations).FirstDisplayedScrollingRowIndex;
		if (firstRow == -1)
		{
			firstRow = 0;
		}
		int firstCol = ((DataGridView)(object)dgvAnalyteConcentrations).FirstDisplayedScrollingColumnIndex;
		firstCol = ((firstCol != -1) ? firstCol : 0);
		((DataGridView)(object)dgvAnalyteConcentrations).Columns.Clear();
		SetupAnalyteConcentrationHeader();
		SetupAnalyteConcentrationDatasForResult();
		((DataGridView)(object)dgvAnalyteConcentrations).Columns.Add("sample", Lang.Txt("FormNumerics.Columns.SampleName.Text"));
		foreach (IsotopeInfos isotope in experiment.Isotopes)
		{
			if (!isotope.isInterference && isotope.visible)
			{
				DataGridViewColumn col = new DataGridViewColumn();
				col.Name = isotope.symbol;
				col.HeaderText = isotope.symbol + "(" + isotope.units + ")";
				col.ValueType = typeof(double);
				col.CellTemplate = new DataGridViewTextBoxCell();
				((DataGridView)(object)dgvAnalyteConcentrations).Columns.Add(col);
			}
		}
		foreach (IsotopeInfos isotope2 in experiment.Isotopes)
		{
			if (isotope2.visible && !isotope2.isInterference)
			{
				if (isotope2.inter && ((DataGridView)(object)dgvAnalyteConcentrations).Columns.Contains(isotope2.symbol))
				{
					((DataGridView)(object)dgvAnalyteConcentrations).Columns[isotope2.symbol].DefaultCellStyle.BackColor = Color.Yellow;
				}
				else
				{
					((DataGridView)(object)dgvAnalyteConcentrations).Columns[isotope2.symbol].DefaultCellStyle.BackColor = Color.FromKnownColor(KnownColor.Control);
				}
			}
		}
		((DataGridView)(object)dgvAnalyteConcentrations).Columns["sample"].HeaderText = Lang.Txt("FormNumerics.Columns.SampleName.Text");
		((DataGridView)(object)dgvAnalyteConcentrations).Columns["sample"].Width = 90;
		((DataGridView)(object)dgvAnalyteConcentrations).Columns["sample"].Frozen = true;
		foreach (DataGridViewColumn column in ((DataGridView)(object)dgvAnalyteConcentrations).Columns)
		{
			column.SortMode = DataGridViewColumnSortMode.NotSortable;
		}
		((DataGridView)(object)dgvAnalyteConcentrations).RowCount = dtConcentration.Rows.Count;
		for (int j = 0; j < ((DataGridView)(object)dgvAnalyteConcentrations).Rows.Count; j++)
		{
			((DataGridView)(object)dgvAnalyteConcentrations).Rows[j].HeaderCell.Value = "";
			((DataGridView)(object)dgvAnalyteConcentrations).RowHeadersWidth = 60;
		}
		int rowCount = GetDataGridViewVisableRowCount((DataGridView)(object)dgvAnalyteConcentrations);
		int colCount = GetDataGridViewVisableColumnCount((DataGridView)(object)dgvAnalyteConcentrations);
		((Control)(object)dgvAnalyteConcentrations).SuspendLayout();
		if (firstCol != 0 && ((DataGridView)(object)dgvAnalyteConcentrations).Columns.Count > firstCol)
		{
			((DataGridView)(object)dgvAnalyteConcentrations).FirstDisplayedScrollingColumnIndex = firstCol;
		}
		if (firstRow != 0 && ((DataGridView)(object)dgvAnalyteConcentrations).Rows.Count > firstRow)
		{
			((DataGridView)(object)dgvAnalyteConcentrations).FirstDisplayedScrollingRowIndex = firstRow;
		}
		for (int i = firstRow; i <= firstRow + rowCount - 1; i++)
		{
			for (int k = firstCol; k <= firstCol + colCount - 1; k++)
			{
				if (i < ((DataGridView)(object)dgvAnalyteConcentrations).Rows.Count && k < ((DataGridView)(object)dgvAnalyteConcentrations).Columns.Count)
				{
					((DataGridView)(object)dgvAnalyteConcentrations).InvalidateCell(((DataGridView)(object)dgvAnalyteConcentrations).Rows[i].Cells[k]);
				}
			}
		}
		((Control)(object)dgvAnalyteConcentrations).ResumeLayout();
	}

	private void InitConcentration()
	{
		((Control)(object)dgvAnalyteICPS).SuspendLayout();
		int firstRow = ((DataGridView)(object)dgvAnalyteConcentrations).FirstDisplayedScrollingRowIndex;
		if (firstRow == -1)
		{
			firstRow = 0;
		}
		int firstCol = ((DataGridView)(object)dgvAnalyteConcentrations).FirstDisplayedScrollingColumnIndex;
		firstCol = ((firstCol != -1) ? firstCol : 0);
		((DataGridView)(object)dgvAnalyteConcentrations).Columns.Clear();
		((DataGridView)(object)dgvAnalyteConcentrations).Columns.Add("sample", Lang.Txt("FormNumerics.Columns.SampleName.Text"));
		((DataGridView)(object)dgvAnalyteConcentrations).Columns["sample"].Tag = false;
		foreach (IsotopeInfos isotope in experiment.Isotopes)
		{
			if (!isotope.isInterference && isotope.visible)
			{
				DataGridViewColumn col = new DataGridViewColumn();
				col.Name = isotope.symbol;
				col.HeaderText = isotope.symbol + "(" + isotope.units + ")";
				col.ValueType = typeof(double);
				col.CellTemplate = new DataGridViewTextBoxCell();
				col.Tag = isotope.inter;
				((DataGridView)(object)dgvAnalyteConcentrations).Columns.Add(col);
			}
		}
		foreach (IsotopeInfos isotope2 in experiment.Isotopes)
		{
			if (isotope2.visible && !isotope2.isInterference)
			{
				if (isotope2.inter && ((DataGridView)(object)dgvAnalyteConcentrations).Columns.Contains(isotope2.symbol))
				{
					((DataGridView)(object)dgvAnalyteConcentrations).Columns[isotope2.symbol].DefaultCellStyle.BackColor = Color.Yellow;
				}
				else
				{
					((DataGridView)(object)dgvAnalyteConcentrations).Columns[isotope2.symbol].DefaultCellStyle.BackColor = Color.FromKnownColor(KnownColor.Control);
				}
			}
		}
		((DataGridView)(object)dgvAnalyteConcentrations).Columns["sample"].HeaderText = Lang.Txt("FormNumerics.Columns.SampleName.Text");
		((DataGridView)(object)dgvAnalyteConcentrations).Columns["sample"].Width = 90;
		((DataGridView)(object)dgvAnalyteConcentrations).Columns["sample"].Frozen = true;
		foreach (DataGridViewColumn column in ((DataGridView)(object)dgvAnalyteConcentrations).Columns)
		{
			column.SortMode = DataGridViewColumnSortMode.NotSortable;
		}
		int count = experiment.Samples.FindAll((SamplesInfos r) => r.report && r.status != 0).Count();
		((DataGridView)(object)dgvAnalyteConcentrations).RowCount = (experiment.ReportParams.ShowRsd ? (count * 2) : count);
		if (firstCol != 0 && ((DataGridView)(object)dgvAnalyteConcentrations).Columns.Count > firstCol)
		{
			((DataGridView)(object)dgvAnalyteConcentrations).FirstDisplayedScrollingColumnIndex = firstCol;
		}
		if (firstRow != 0 && ((DataGridView)(object)dgvAnalyteConcentrations).Rows.Count > firstRow)
		{
			((DataGridView)(object)dgvAnalyteConcentrations).FirstDisplayedScrollingRowIndex = firstRow;
		}
		((Control)(object)dgvAnalyteConcentrations).ResumeLayout();
	}

	private int GetDataGridViewVisableRowCount(DataGridView grid)
	{
		if (grid.Rows.Count <= 0)
		{
			return 0;
		}
		int rowheight = 23;
		int rowindex = grid.FirstDisplayedScrollingRowIndex;
		int height = 0;
		if (grid.ColumnHeadersVisible)
		{
			height = grid.ColumnHeadersHeight;
		}
		while (height < grid.Height && rowindex < grid.Rows.Count)
		{
			height += rowheight;
			rowindex++;
		}
		return rowindex - grid.FirstDisplayedScrollingRowIndex;
	}

	private int GetDataGridViewVisableColumnCount(DataGridView grid)
	{
		if (grid.Columns.Count <= 0)
		{
			return 0;
		}
		int Colindex = grid.FirstDisplayedScrollingColumnIndex;
		int colwidth = 90;
		int height = 0;
		if (grid.RowHeadersVisible)
		{
			height = grid.RowHeadersWidth;
		}
		while (height < grid.Height && Colindex < grid.Columns.Count)
		{
			height += colwidth;
			Colindex++;
		}
		return Colindex - grid.FirstDisplayedScrollingColumnIndex;
	}

	private void SetupAnalyteConcentrationHeader()
	{
		dtConcentration.Columns.Clear();
		dtConcentration.Columns.Add("sample");
		DataColumn column = dtConcentration.Columns.Add("header");
		column.ColumnMapping = MappingType.Hidden;
		foreach (IsotopeInfos isotope in experiment.Isotopes)
		{
			if (!isotope.isInterference && isotope.visible)
			{
				DataColumn dc = dtConcentration.Columns.Add(isotope.symbol, typeof(double));
				if (isotope.inter)
				{
					dc.ExtendedProperties.Add(true, true);
				}
				else
				{
					dc.ExtendedProperties.Clear();
				}
			}
		}
	}

	private void SetupAnalyteConcentrationDatas()
	{
		try
		{
			dtConcentration.Rows.Clear();
			foreach (SamplesInfos sample in experiment.Samples)
			{
				if (sample.status == 0 || !sample.report)
				{
					continue;
				}
				DataRow rowEmpty = dtConcentration.NewRow();
				rowEmpty["header"] = "";
				rowEmpty["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
				foreach (IsotopeInfos isotope3 in experiment.Isotopes)
				{
					if (!isotope3.isInterference && isotope3.visible)
					{
						rowEmpty[isotope3.symbol] = -1;
					}
				}
				if (experiment.ReportParams.ShowRuns)
				{
					for (int i = 0; i < sample.mains; i++)
					{
						DataRow row = dtConcentration.NewRow();
						row["header"] = i + 1;
						row["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
						foreach (IsotopeInfos isotope2 in experiment.Isotopes)
						{
							if (!isotope2.isInterference && isotope2.visible)
							{
								IEnumerable<AnalyseInfos> value = experiment.Results.Where((AnalyseInfos result) => result.sampleId == sample.guid && result.symbol == isotope2.symbol && result.number == i);
								row[isotope2.symbol] = value.First().concentration;
							}
						}
						dtConcentration.Rows.Add(row);
					}
				}
				DataRow r1 = dtConcentration.NewRow();
				r1["header"] = "χ";
				r1["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
				DataRow r2 = dtConcentration.NewRow();
				r2["header"] = "σ";
				r2["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
				DataRow r3 = dtConcentration.NewRow();
				r3["header"] = "%RSD";
				r3["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
				foreach (IsotopeInfos isotope in experiment.Isotopes)
				{
					if (!isotope.isInterference && isotope.visible)
					{
						StatisticResults stat = experiment.Statistics.Where((StatisticResults statistic) => statistic.sampleId == sample.guid && statistic.symbol == isotope.symbol).First();
						r1[isotope.symbol] = stat.avgCon;
						r2[isotope.symbol] = stat.sdCon;
						r3[isotope.symbol] = stat.rsdCon;
					}
				}
				if (experiment.ReportParams.ShowMean)
				{
					dtConcentration.Rows.Add(r1);
				}
				if (experiment.ReportParams.ShowSd)
				{
					dtConcentration.Rows.Add(r2);
				}
				if (experiment.ReportParams.ShowRsd)
				{
					dtConcentration.Rows.Add(r3);
				}
			}
		}
		catch (Exception ex)
		{
			Log.InsertLog(Lang.Txt("AddFormNumerics.ConcentrationDisplay"), Lang.Txt("AddFormNumerics.IncorrectDisplay"), ex.Message, (Severity)3);
		}
	}

	private void SetupAnalyteConcentrationDatasForResult()
	{
		try
		{
			dtConcentration.Rows.Clear();
			foreach (SamplesInfos sample in experiment.Samples)
			{
				if (sample.status == 0 || !sample.report)
				{
					continue;
				}
				DataRow rowEmpty = dtConcentration.NewRow();
				rowEmpty["header"] = "";
				rowEmpty["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
				foreach (IsotopeInfos isotope2 in experiment.Isotopes)
				{
					if (!isotope2.isInterference && isotope2.visible)
					{
						rowEmpty[isotope2.symbol] = -1;
					}
				}
				DataRow r1 = dtConcentration.NewRow();
				r1["header"] = "χ";
				r1["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
				DataRow r2 = dtConcentration.NewRow();
				r2["header"] = "%RSD";
				r2["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
				foreach (IsotopeInfos isotope in experiment.Isotopes)
				{
					if (!isotope.isInterference && isotope.visible)
					{
						StatisticResults stat = experiment.Statistics.Where((StatisticResults statistic) => statistic.sampleId == sample.guid && statistic.symbol == isotope.symbol).First();
						r1[isotope.symbol] = stat.avgCon;
						r2[isotope.symbol] = stat.rsdCon;
					}
				}
				if (experiment.ReportParams.ShowMean)
				{
					dtConcentration.Rows.Add(r1);
				}
				if (experiment.ReportParams.ShowRsd)
				{
					dtConcentration.Rows.Add(r2);
				}
			}
		}
		catch (Exception ex)
		{
			Log.InsertLog(Lang.Txt("AddFormNumerics.ConcentrationDisplay"), Lang.Txt("AddFormNumerics.IncorrectDisplay"), ex.Message, (Severity)3);
		}
	}

	private void SetupAnalyteConcentrationDatasForSingleSample(SamplesInfos sample)
	{
		try
		{
			dtConcentrationSingle.Rows.Clear();
			ptExclude1.Clear();
			int currentRow = 0;
			int currentCol = 0;
			if (sample.status == 0 || !sample.report)
			{
				return;
			}
			for (int i = 0; i < sample.mains; i++)
			{
				DataRow row = dtConcentrationSingle.NewRow();
				row["header"] = i + 1;
				row["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
				currentCol = 0;
				foreach (IsotopeInfos isotope2 in experiment.Isotopes)
				{
					if (!isotope2.isInterference && isotope2.visible)
					{
						IEnumerable<AnalyseInfos> value = experiment.Results.Where((AnalyseInfos result) => result.sampleId == sample.guid && result.symbol == isotope2.symbol && result.number == i);
						row[isotope2.symbol] = value.First().concentration;
						if (value.First().exclude)
						{
							ptExclude1.Add(new List<int>
							{
								sample.guid,
								currentRow,
								currentCol + 1
							});
						}
						currentCol++;
					}
				}
				dtConcentrationSingle.Rows.Add(row);
				currentRow++;
			}
			DataRow r1 = dtConcentrationSingle.NewRow();
			r1["header"] = "χ";
			r1["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
			DataRow r2 = dtConcentrationSingle.NewRow();
			r2["header"] = "σ";
			r2["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
			DataRow r3 = dtConcentrationSingle.NewRow();
			r3["header"] = "%RSD";
			r3["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
			foreach (IsotopeInfos isotope in experiment.Isotopes)
			{
				if (!isotope.isInterference && isotope.visible)
				{
					StatisticResults stat = experiment.Statistics.Where((StatisticResults statistic) => statistic.sampleId == sample.guid && statistic.symbol == isotope.symbol).First();
					r1[isotope.symbol] = stat.avgCon;
					r2[isotope.symbol] = stat.sdCon;
					r3[isotope.symbol] = stat.rsdCon;
				}
			}
			dtConcentrationSingle.Rows.Add(r1);
			dtConcentrationSingle.Rows.Add(r2);
			dtConcentrationSingle.Rows.Add(r3);
		}
		catch (Exception ex)
		{
			Log.InsertLog(Lang.Txt("AddFormNumerics.ConcentrationDisplay"), Lang.Txt("AddFormNumerics.IncorrectDisplay"), ex.Message, (Severity)3);
		}
	}

	private void SetupAnalyteConcentrationHeaderForSingleSample()
	{
		dtConcentrationSingle.Columns.Clear();
		dtConcentrationSingle.Columns.Add("sample");
		DataColumn column = dtConcentrationSingle.Columns.Add("header");
		column.ColumnMapping = MappingType.Hidden;
		foreach (IsotopeInfos isotope in experiment.Isotopes)
		{
			if (!isotope.isInterference && isotope.visible)
			{
				DataColumn dc = dtConcentrationSingle.Columns.Add(isotope.symbol, typeof(double));
				if (isotope.inter)
				{
					dc.ExtendedProperties.Add(true, true);
				}
				else
				{
					dc.ExtendedProperties.Clear();
				}
			}
		}
	}

	private void InitConcentrationForSingle(SamplesInfos sample)
	{
		int firstRow = ((DataGridView)(object)dataGridView1).FirstDisplayedScrollingRowIndex;
		firstRow = ((firstRow != -1) ? firstRow : 0);
		int firstCol = ((DataGridView)(object)dataGridView1).FirstDisplayedScrollingColumnIndex;
		firstCol = ((firstCol != -1) ? firstCol : 0);
		((Control)(object)dataGridView1).Tag = sample.guid;
		((DataGridView)(object)dataGridView1).Columns.Clear();
		SetupAnalyteConcentrationHeaderForSingleSample();
		SetupAnalyteConcentrationDatasForSingleSample(sample);
		((DataGridView)(object)dataGridView1).Columns.Add("sample", Lang.Txt("FormNumerics.Columns.SampleName.Text"));
		foreach (IsotopeInfos isotope in experiment.Isotopes)
		{
			if (!isotope.isInterference && isotope.visible)
			{
				DataGridViewColumn col = new DataGridViewColumn();
				col.Name = isotope.symbol;
				col.HeaderText = isotope.symbol + "(" + isotope.units + ")";
				col.ValueType = typeof(double);
				col.CellTemplate = new DataGridViewTextBoxCell();
				((DataGridView)(object)dataGridView1).Columns.Add(col);
			}
		}
		foreach (IsotopeInfos isotope2 in experiment.Isotopes)
		{
			if (isotope2.visible && !isotope2.isInterference)
			{
				if (isotope2.inter && ((DataGridView)(object)dataGridView1).Columns.Contains(isotope2.symbol))
				{
					((DataGridView)(object)dataGridView1).Columns[isotope2.symbol].DefaultCellStyle.BackColor = Color.Yellow;
				}
				else
				{
					((DataGridView)(object)dataGridView1).Columns[isotope2.symbol].DefaultCellStyle.BackColor = Color.FromKnownColor(KnownColor.Control);
				}
			}
		}
		((DataGridView)(object)dataGridView1).Columns["sample"].HeaderText = Lang.Txt("FormNumerics.Columns.SampleName.Text");
		((DataGridView)(object)dataGridView1).Columns["sample"].Width = 90;
		((DataGridView)(object)dataGridView1).Columns["sample"].Frozen = true;
		foreach (DataGridViewColumn column in ((DataGridView)(object)dataGridView1).Columns)
		{
			column.SortMode = DataGridViewColumnSortMode.NotSortable;
		}
		((DataGridView)(object)dataGridView1).RowCount = dtConcentrationSingle.Rows.Count;
		for (int j = 0; j < ((DataGridView)(object)dataGridView1).Rows.Count; j++)
		{
			((DataGridView)(object)dataGridView1).Rows[j].HeaderCell.Value = dtConcentrationSingle.Rows[j]["header"];
			((DataGridView)(object)dataGridView1).RowHeadersWidth = 60;
		}
		int rowCount = GetDataGridViewVisableRowCount((DataGridView)(object)dataGridView1);
		int ColCount = GetDataGridViewVisableColumnCount((DataGridView)(object)dataGridView1);
		((Control)(object)dataGridView1).SuspendLayout();
		if (firstCol != 0 && ((DataGridView)(object)dataGridView1).Columns.Count > firstCol)
		{
			((DataGridView)(object)dataGridView1).FirstDisplayedScrollingColumnIndex = firstCol;
		}
		if (firstRow != 0 && ((DataGridView)(object)dataGridView1).Rows.Count > firstRow)
		{
			((DataGridView)(object)dataGridView1).FirstDisplayedScrollingRowIndex = firstRow;
		}
		for (int i = firstRow; i <= firstRow + rowCount - 1; i++)
		{
			for (int k = firstCol; k <= firstCol + ColCount - 1; k++)
			{
				if (i < ((DataGridView)(object)dataGridView1).Rows.Count && k < ((DataGridView)(object)dataGridView1).Columns.Count)
				{
					((DataGridView)(object)dataGridView1).InvalidateCell(((DataGridView)(object)dataGridView1).Rows[i].Cells[k]);
				}
			}
		}
		((Control)(object)dataGridView1).ResumeLayout();
	}

	private void InitUncorrectedICPS()
	{
		((Control)(object)dgvUncorrectedICPS).SuspendLayout();
		int firstRow = ((DataGridView)(object)dgvUncorrectedICPS).FirstDisplayedScrollingRowIndex;
		firstRow = ((firstRow != -1) ? firstRow : 0);
		int firstCol = ((DataGridView)(object)dgvUncorrectedICPS).FirstDisplayedScrollingColumnIndex;
		firstCol = ((firstCol != -1) ? firstCol : 0);
		((DataGridView)(object)dgvUncorrectedICPS).Columns.Clear();
		SetupUncorrectedICPSHeader();
		SetupUncorrectedICPSDatas();
		((DataGridView)(object)dgvUncorrectedICPS).Columns.Add("sample", Lang.Txt("FormNumerics.Columns.SampleName.Text"));
		foreach (IsotopeInfos isotope2 in experiment.Isotopes)
		{
			if (!isotope2.isInterference && isotope2.visible)
			{
				DataGridViewColumn col = new DataGridViewColumn();
				col.Name = isotope2.symbol;
				col.HeaderText = isotope2.symbol;
				col.ValueType = typeof(double);
				col.CellTemplate = new DataGridViewTextBoxCell();
				((DataGridView)(object)dgvUncorrectedICPS).Columns.Add(col);
			}
		}
		foreach (IsotopeInfos isotope in experiment.Isotopes)
		{
			if (isotope.visible && !isotope.isInterference)
			{
				if (isotope.inter && ((DataGridView)(object)dgvUncorrectedICPS).Columns.Contains(isotope.symbol))
				{
					((DataGridView)(object)dgvUncorrectedICPS).Columns[isotope.symbol].DefaultCellStyle.BackColor = Color.Yellow;
				}
				else
				{
					((DataGridView)(object)dgvUncorrectedICPS).Columns[isotope.symbol].DefaultCellStyle.BackColor = Color.FromKnownColor(KnownColor.Control);
				}
			}
		}
		((DataGridView)(object)dgvUncorrectedICPS).Columns["sample"].HeaderText = Lang.Txt("FormNumerics.Columns.SampleName.Text");
		((DataGridView)(object)dgvUncorrectedICPS).Columns["sample"].Width = 90;
		((DataGridView)(object)dgvUncorrectedICPS).Columns["sample"].Frozen = true;
		foreach (DataGridViewColumn column in ((DataGridView)(object)dgvUncorrectedICPS).Columns)
		{
			column.SortMode = DataGridViewColumnSortMode.NotSortable;
		}
		((DataGridView)(object)dgvUncorrectedICPS).RowCount = dtUncorrectedICPS.Rows.Count;
		if (firstCol != 0 && ((DataGridView)(object)dgvUncorrectedICPS).Columns.Count > firstCol)
		{
			((DataGridView)(object)dgvUncorrectedICPS).FirstDisplayedScrollingColumnIndex = firstCol;
		}
		if (firstRow != 0 && ((DataGridView)(object)dgvUncorrectedICPS).Rows.Count > firstRow)
		{
			((DataGridView)(object)dgvUncorrectedICPS).FirstDisplayedScrollingRowIndex = firstRow;
		}
		((Control)(object)dgvUncorrectedICPS).ResumeLayout();
	}

	private void SetupUncorrectedICPSHeader()
	{
		dtUncorrectedICPS.Columns.Clear();
		dtUncorrectedICPS.Columns.Add("sample");
		DataColumn column = dtUncorrectedICPS.Columns.Add("header");
		column.ColumnMapping = MappingType.Hidden;
		foreach (IsotopeInfos isotope in experiment.Isotopes)
		{
			if (!isotope.isInterference && isotope.visible)
			{
				DataColumn dc = dtUncorrectedICPS.Columns.Add(isotope.symbol, typeof(double));
				if (isotope.inter)
				{
					dc.ExtendedProperties.Add(true, true);
				}
				else
				{
					dc.ExtendedProperties.Clear();
				}
			}
		}
	}

	private void SetupUncorrectedICPSDatas()
	{
		dtUncorrectedICPS.Rows.Clear();
		int currentRow = 0;
		ptExclude1.Clear();
		foreach (SamplesInfos sample in experiment.Samples)
		{
			if (sample.status == 0 || !sample.report)
			{
				continue;
			}
			DataRow rowEmpty = dtUncorrectedICPS.NewRow();
			rowEmpty["header"] = "";
			rowEmpty["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
			foreach (IsotopeInfos isotope2 in experiment.Isotopes)
			{
				if (!isotope2.isInterference && isotope2.visible)
				{
					rowEmpty[isotope2.symbol] = -1;
				}
			}
			DataRow r1 = dtUncorrectedICPS.NewRow();
			r1["header"] = "χ";
			r1["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
			DataRow r2 = dtUncorrectedICPS.NewRow();
			r2["header"] = "%RSD";
			r2["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
			foreach (IsotopeInfos isotope in experiment.Isotopes)
			{
				if (!isotope.isInterference && isotope.visible)
				{
					IEnumerable<StatisticResults> stats = experiment.Statistics.Where((StatisticResults statistic) => statistic.sampleId == sample.guid && statistic.symbol == isotope.symbol);
					if (stats != null && stats.Count() > 0)
					{
						StatisticResults stat = stats.First();
						r1[isotope.symbol] = stat.avgUICPS;
						r2[isotope.symbol] = stat.rsdUICPS;
						continue;
					}
					StatisticResults stat2 = new StatisticResults
					{
						sampleId = sample.guid,
						symbol = isotope.symbol,
						rsdCon = -1.0,
						rsdCPS = -1.0,
						rsdUICPS = -1.0,
						sdCon = -1.0,
						sdCPS = -1.0,
						sdUICPS = -1.0,
						avgCPS = -1.0,
						avgUICPS = -1.0,
						avgCon = -1.0,
						avgUICPSANA = -1.0,
						avgUICPSPC = -1.0,
						label = sample.label,
						mass = sample.mass,
						volume = sample.volume,
						isotopeId = isotope.id
					};
					experiment.Statistics.Add(stat2);
				}
			}
			if (experiment.ReportParams.ShowMean)
			{
				dtUncorrectedICPS.Rows.Add(r1);
				currentRow++;
			}
			if (experiment.ReportParams.ShowRsd)
			{
				dtUncorrectedICPS.Rows.Add(r2);
				currentRow++;
			}
		}
	}

	private void SetupUncorrectCPSDatasForSingleSample(SamplesInfos sample)
	{
		try
		{
			dtUncorrectCPSSingle.Rows.Clear();
			ptExclude1.Clear();
			int currentRow = 0;
			int currentCol = 0;
			if (sample.status == 0 || !sample.report)
			{
				return;
			}
			for (int i = 0; i < sample.mains; i++)
			{
				DataRow row = dtUncorrectCPSSingle.NewRow();
				row["header"] = i + 1;
				row["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
				currentCol = 0;
				foreach (IsotopeInfos isotope2 in experiment.Isotopes)
				{
					if (!isotope2.isInterference && isotope2.visible)
					{
						IEnumerable<AnalyseInfos> value = experiment.Results.Where((AnalyseInfos result) => result.sampleId == sample.guid && result.symbol == isotope2.symbol && result.number == i);
						row[isotope2.symbol] = value.First().intensity;
						if (value.First().exclude)
						{
							ptExclude1.Add(new List<int>
							{
								sample.guid,
								currentRow,
								currentCol + 1
							});
						}
						currentCol++;
					}
				}
				dtUncorrectCPSSingle.Rows.Add(row);
				currentRow++;
			}
			DataRow r1 = dtUncorrectCPSSingle.NewRow();
			r1["header"] = "χ";
			r1["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
			DataRow r2 = dtUncorrectCPSSingle.NewRow();
			r2["header"] = "σ";
			r2["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
			DataRow r3 = dtUncorrectCPSSingle.NewRow();
			r3["header"] = "%RSD";
			r3["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
			foreach (IsotopeInfos isotope in experiment.Isotopes)
			{
				if (!isotope.isInterference && isotope.visible)
				{
					StatisticResults stat = experiment.Statistics.Where((StatisticResults statistic) => statistic.sampleId == sample.guid && statistic.symbol == isotope.symbol).First();
					r1[isotope.symbol] = stat.avgUICPS;
					r2[isotope.symbol] = stat.sdUICPS;
					r3[isotope.symbol] = stat.rsdUICPS;
				}
			}
			dtUncorrectCPSSingle.Rows.Add(r1);
			dtUncorrectCPSSingle.Rows.Add(r2);
			dtUncorrectCPSSingle.Rows.Add(r3);
		}
		catch (Exception ex)
		{
			Log.InsertLog(Lang.Txt("AddFormNumerics.ConcentrationDisplay"), Lang.Txt("AddFormNumerics.IncorrectDisplay"), ex.Message, (Severity)3);
		}
	}

	private void SetupUncorrectCPSHeaderForSingleSample()
	{
		dtUncorrectCPSSingle.Columns.Clear();
		dtUncorrectCPSSingle.Columns.Add("sample");
		DataColumn column = dtUncorrectCPSSingle.Columns.Add("header");
		column.ColumnMapping = MappingType.Hidden;
		foreach (IsotopeInfos isotope in experiment.Isotopes)
		{
			if (!isotope.isInterference && isotope.visible)
			{
				DataColumn dc = dtUncorrectCPSSingle.Columns.Add(isotope.symbol, typeof(double));
				if (isotope.inter)
				{
					dc.ExtendedProperties.Add(true, true);
				}
				else
				{
					dc.ExtendedProperties.Clear();
				}
			}
		}
	}

	private void InitUncorrectCPSForSingle(SamplesInfos sample)
	{
		int firstRow = ((DataGridView)(object)rowMergeView1).FirstDisplayedScrollingRowIndex;
		firstRow = ((firstRow != -1) ? firstRow : 0);
		int firstCol = ((DataGridView)(object)rowMergeView1).FirstDisplayedScrollingColumnIndex;
		firstCol = ((firstCol != -1) ? firstCol : 0);
		((Control)(object)rowMergeView1).Tag = sample.guid;
		((DataGridView)(object)rowMergeView1).Columns.Clear();
		SetupUncorrectCPSHeaderForSingleSample();
		SetupUncorrectCPSDatasForSingleSample(sample);
		((DataGridView)(object)rowMergeView1).Columns.Add("sample", Lang.Txt("FormNumerics.Columns.SampleName.Text"));
		foreach (IsotopeInfos isotope in experiment.Isotopes)
		{
			if (!isotope.isInterference && isotope.visible)
			{
				DataGridViewColumn col = new DataGridViewColumn();
				col.Name = isotope.symbol;
				col.ValueType = typeof(double);
				col.CellTemplate = new DataGridViewTextBoxCell();
				((DataGridView)(object)rowMergeView1).Columns.Add(col);
			}
		}
		foreach (IsotopeInfos isotope2 in experiment.Isotopes)
		{
			if (isotope2.visible && !isotope2.isInterference)
			{
				if (isotope2.inter && ((DataGridView)(object)rowMergeView1).Columns.Contains(isotope2.symbol))
				{
					((DataGridView)(object)rowMergeView1).Columns[isotope2.symbol].DefaultCellStyle.BackColor = Color.Yellow;
				}
				else
				{
					((DataGridView)(object)rowMergeView1).Columns[isotope2.symbol].DefaultCellStyle.BackColor = Color.FromKnownColor(KnownColor.Control);
				}
			}
		}
		((DataGridView)(object)rowMergeView1).Columns["sample"].HeaderText = Lang.Txt("FormNumerics.Columns.SampleName.Text");
		((DataGridView)(object)rowMergeView1).Columns["sample"].Width = 90;
		((DataGridView)(object)rowMergeView1).Columns["sample"].Frozen = true;
		foreach (DataGridViewColumn column in ((DataGridView)(object)rowMergeView1).Columns)
		{
			column.SortMode = DataGridViewColumnSortMode.NotSortable;
		}
		((DataGridView)(object)rowMergeView1).RowCount = dtUncorrectCPSSingle.Rows.Count;
		for (int j = 0; j < ((DataGridView)(object)rowMergeView1).Rows.Count; j++)
		{
			((DataGridView)(object)rowMergeView1).Rows[j].HeaderCell.Value = dtUncorrectCPSSingle.Rows[j]["header"];
			((DataGridView)(object)rowMergeView1).RowHeadersWidth = 60;
		}
		int rowCount = GetDataGridViewVisableRowCount((DataGridView)(object)rowMergeView1);
		int ColCount = GetDataGridViewVisableColumnCount((DataGridView)(object)rowMergeView1);
		((Control)(object)rowMergeView1).SuspendLayout();
		if (firstCol != 0 && ((DataGridView)(object)rowMergeView1).Columns.Count > firstCol)
		{
			((DataGridView)(object)rowMergeView1).FirstDisplayedScrollingColumnIndex = firstCol;
		}
		if (firstRow != 0 && ((DataGridView)(object)rowMergeView1).Rows.Count > firstRow)
		{
			((DataGridView)(object)rowMergeView1).FirstDisplayedScrollingRowIndex = firstRow;
		}
		for (int i = firstRow; i <= firstRow + rowCount - 1; i++)
		{
			for (int k = firstCol; k <= firstCol + ColCount - 1; k++)
			{
				if (i < ((DataGridView)(object)rowMergeView1).Rows.Count && k < ((DataGridView)(object)rowMergeView1).Columns.Count)
				{
					((DataGridView)(object)rowMergeView1).InvalidateCell(((DataGridView)(object)rowMergeView1).Rows[i].Cells[k]);
				}
			}
		}
		((Control)(object)rowMergeView1).ResumeLayout();
	}

	private void InitAnalyteICPS1()
	{
		int firstRow = ((DataGridView)(object)dgvAnalyteICPS).FirstDisplayedScrollingRowIndex;
		firstRow = ((firstRow != -1) ? firstRow : 0);
		int firstCol = ((DataGridView)(object)dgvAnalyteICPS).FirstDisplayedScrollingColumnIndex;
		firstCol = ((firstCol != -1) ? firstCol : 0);
		SetupAnalyteICPSHeader();
		SetupAnalyteICPSDatas();
		((DataGridView)(object)dgvAnalyteICPS).Columns.Add("sample", Lang.Txt("FormNumerics.Columns.SampleName.Text"));
		foreach (IsotopeInfos isotope in experiment.Isotopes)
		{
			if (!isotope.isInterference && isotope.visible)
			{
				DataGridViewColumn col = new DataGridViewColumn();
				col.Name = isotope.symbol;
				col.HeaderText = isotope.symbol;
				col.ValueType = typeof(double);
				col.CellTemplate = new DataGridViewTextBoxCell();
				((DataGridView)(object)dgvAnalyteICPS).Columns.Add(col);
			}
		}
		foreach (IsotopeInfos isotope2 in experiment.Isotopes)
		{
			if (isotope2.visible && !isotope2.isInterference)
			{
				if (isotope2.inter && ((DataGridView)(object)dgvAnalyteICPS).Columns.Contains(isotope2.symbol))
				{
					((DataGridView)(object)dgvAnalyteICPS).Columns[isotope2.symbol].DefaultCellStyle.BackColor = Color.Yellow;
				}
				else
				{
					((DataGridView)(object)dgvAnalyteICPS).Columns[isotope2.symbol].DefaultCellStyle.BackColor = Color.FromKnownColor(KnownColor.Control);
				}
			}
		}
		((DataGridView)(object)dgvAnalyteICPS).Columns["sample"].HeaderText = Lang.Txt("FormNumerics.Columns.SampleName.Text");
		((DataGridView)(object)dgvAnalyteICPS).Columns["sample"].Width = 90;
		((DataGridView)(object)dgvAnalyteICPS).Columns["sample"].Frozen = true;
		foreach (DataGridViewColumn column in ((DataGridView)(object)dgvAnalyteICPS).Columns)
		{
			column.SortMode = DataGridViewColumnSortMode.NotSortable;
		}
		((DataGridView)(object)dgvAnalyteICPS).RowCount = dtAnalyteICPS.Rows.Count;
		for (int j = 0; j < ((DataGridView)(object)dgvAnalyteICPS).Rows.Count; j++)
		{
			((DataGridView)(object)dgvAnalyteICPS).Rows[j].HeaderCell.Value = "";
			((DataGridView)(object)dgvAnalyteICPS).RowHeadersWidth = 60;
		}
		int rowCount = GetDataGridViewVisableRowCount((DataGridView)(object)dgvAnalyteICPS);
		int ColCount = GetDataGridViewVisableColumnCount((DataGridView)(object)dgvAnalyteICPS);
		((Control)(object)dgvAnalyteICPS).SuspendLayout();
		if (firstCol != 0 && ((DataGridView)(object)dgvAnalyteICPS).Columns.Count > firstCol)
		{
			((DataGridView)(object)dgvAnalyteICPS).FirstDisplayedScrollingColumnIndex = firstCol;
		}
		if (firstRow != 0 && ((DataGridView)(object)dgvAnalyteConcentrations).Rows.Count > firstRow)
		{
			((DataGridView)(object)dgvAnalyteICPS).FirstDisplayedScrollingRowIndex = firstRow;
		}
		for (int i = firstRow; i <= firstRow + rowCount - 1; i++)
		{
			for (int k = firstCol; k <= firstCol + ColCount - 1; k++)
			{
				if (i < ((DataGridView)(object)dgvAnalyteICPS).Rows.Count && k < ((DataGridView)(object)dgvAnalyteICPS).Columns.Count)
				{
					((DataGridView)(object)dgvAnalyteICPS).InvalidateCell(((DataGridView)(object)dgvAnalyteICPS).Rows[i].Cells[k]);
				}
			}
		}
		((Control)(object)dgvAnalyteICPS).ResumeLayout();
	}

	private void InitAnalyteICPS()
	{
		((Control)(object)dgvAnalyteICPS).SuspendLayout();
		int firstRow = ((DataGridView)(object)dgvAnalyteICPS).FirstDisplayedScrollingRowIndex;
		firstRow = ((firstRow != -1) ? firstRow : 0);
		int firstCol = ((DataGridView)(object)dgvAnalyteICPS).FirstDisplayedScrollingColumnIndex;
		firstCol = ((firstCol != -1) ? firstCol : 0);
		((DataGridView)(object)dgvAnalyteICPS).Columns.Clear();
		((DataGridView)(object)dgvAnalyteICPS).Columns.Add("sample", Lang.Txt("FormNumerics.Columns.SampleName.Text"));
		((DataGridView)(object)dgvAnalyteICPS).Columns["sample"].Tag = false;
		foreach (IsotopeInfos isotope in experiment.Isotopes)
		{
			if (!isotope.isInterference && isotope.visible)
			{
				DataGridViewColumn col = new DataGridViewColumn();
				col.Name = isotope.symbol;
				col.HeaderText = isotope.symbol;
				col.ValueType = typeof(double);
				col.CellTemplate = new DataGridViewTextBoxCell();
				col.Tag = isotope.inter;
				((DataGridView)(object)dgvAnalyteICPS).Columns.Add(col);
			}
		}
		foreach (IsotopeInfos isotope2 in experiment.Isotopes)
		{
			if (isotope2.visible && !isotope2.isInterference)
			{
				if (isotope2.inter && ((DataGridView)(object)dgvAnalyteICPS).Columns.Contains(isotope2.symbol))
				{
					((DataGridView)(object)dgvAnalyteICPS).Columns[isotope2.symbol].DefaultCellStyle.BackColor = Color.Yellow;
				}
				else
				{
					((DataGridView)(object)dgvAnalyteICPS).Columns[isotope2.symbol].DefaultCellStyle.BackColor = Color.FromKnownColor(KnownColor.Control);
				}
			}
		}
		((DataGridView)(object)dgvAnalyteICPS).Columns["sample"].HeaderText = Lang.Txt("FormNumerics.Columns.SampleName.Text");
		((DataGridView)(object)dgvAnalyteICPS).Columns["sample"].Width = 90;
		((DataGridView)(object)dgvAnalyteICPS).Columns["sample"].Frozen = true;
		foreach (DataGridViewColumn column in ((DataGridView)(object)dgvAnalyteICPS).Columns)
		{
			column.SortMode = DataGridViewColumnSortMode.NotSortable;
		}
		int rowcount = experiment.Samples.FindAll((SamplesInfos r) => r.report && r.status != 0).Count();
		((DataGridView)(object)dgvAnalyteICPS).RowCount = (experiment.ReportParams.ShowRsd ? (rowcount * 2) : rowcount);
		if (firstCol != 0 && ((DataGridView)(object)dgvAnalyteICPS).Columns.Count > firstCol)
		{
			((DataGridView)(object)dgvAnalyteICPS).FirstDisplayedScrollingColumnIndex = firstCol;
		}
		if (firstRow != 0 && ((DataGridView)(object)dgvAnalyteICPS).Rows.Count > firstRow)
		{
			((DataGridView)(object)dgvAnalyteICPS).FirstDisplayedScrollingRowIndex = firstRow;
		}
		((Control)(object)dgvAnalyteICPS).ResumeLayout();
	}

	private void SetupAnalyteICPSHeader()
	{
		((DataGridView)(object)dgvAnalyteICPS).Columns.Clear();
		dtAnalyteICPS.Columns.Clear();
		dtAnalyteICPS.Columns.Add("sample");
		DataColumn column = dtAnalyteICPS.Columns.Add("header");
		column.ColumnMapping = MappingType.Hidden;
		foreach (IsotopeInfos isotope in experiment.Isotopes)
		{
			if (!isotope.isInterference && isotope.visible)
			{
				DataColumn dc = dtAnalyteICPS.Columns.Add(isotope.symbol, typeof(double));
				if (isotope.inter)
				{
					dc.ExtendedProperties.Add(true, true);
				}
				else
				{
					dc.ExtendedProperties.Clear();
				}
			}
		}
	}

	private void SetupAnalyteICPSDatas()
	{
		dtAnalyteICPS.Rows.Clear();
		foreach (SamplesInfos sample in experiment.Samples)
		{
			if (sample.status == 0 || !sample.report)
			{
				continue;
			}
			DataRow rowEmpty = dtAnalyteICPS.NewRow();
			rowEmpty["header"] = "";
			rowEmpty["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
			foreach (IsotopeInfos isotope2 in experiment.Isotopes)
			{
				if (!isotope2.isInterference && isotope2.visible)
				{
					rowEmpty[isotope2.symbol] = -1;
				}
			}
			DataRow r1 = dtAnalyteICPS.NewRow();
			r1["header"] = "χ";
			r1["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
			DataRow r2 = dtAnalyteICPS.NewRow();
			r2["header"] = "%RSD";
			r2["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
			foreach (IsotopeInfos isotope in experiment.Isotopes)
			{
				if (!isotope.isInterference && isotope.visible)
				{
					StatisticResults stat = experiment.Statistics.Where((StatisticResults statistic) => statistic.sampleId == sample.guid && statistic.symbol == isotope.symbol).First();
					r1[isotope.symbol] = stat.avgCPS;
					r2[isotope.symbol] = stat.rsdCPS;
				}
			}
			if (experiment.ReportParams.ShowMean)
			{
				dtAnalyteICPS.Rows.Add(r1);
			}
			if (experiment.ReportParams.ShowRsd)
			{
				dtAnalyteICPS.Rows.Add(r2);
			}
		}
	}

	private void SetupAnalyteICPSDatasForSingleSample(SamplesInfos sample)
	{
		try
		{
			dtAnalyteICPSSingle.Rows.Clear();
			ptExclude1.Clear();
			int currentRow = 0;
			int currentCol = 0;
			if (sample.status == 0 || !sample.report)
			{
				return;
			}
			for (int i = 0; i < sample.mains; i++)
			{
				DataRow row = dtAnalyteICPSSingle.NewRow();
				row["header"] = i + 1;
				row["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
				currentCol = 0;
				foreach (IsotopeInfos isotope2 in experiment.Isotopes)
				{
					if (!isotope2.isInterference && isotope2.visible)
					{
						IEnumerable<AnalyseInfos> value = experiment.Results.Where((AnalyseInfos result) => result.sampleId == sample.guid && result.symbol == isotope2.symbol && result.number == i);
						row[isotope2.symbol] = value.First().icps;
						if (value.First().exclude)
						{
							ptExclude1.Add(new List<int>
							{
								sample.guid,
								currentRow,
								currentCol + 1
							});
						}
						currentCol++;
					}
				}
				dtAnalyteICPSSingle.Rows.Add(row);
				currentRow++;
			}
			DataRow r1 = dtAnalyteICPSSingle.NewRow();
			r1["header"] = "χ";
			r1["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
			DataRow r2 = dtAnalyteICPSSingle.NewRow();
			r2["header"] = "σ";
			r2["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
			DataRow r3 = dtAnalyteICPSSingle.NewRow();
			r3["header"] = "%RSD";
			r3["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
			foreach (IsotopeInfos isotope in experiment.Isotopes)
			{
				if (!isotope.isInterference && isotope.visible)
				{
					StatisticResults stat = experiment.Statistics.Where((StatisticResults statistic) => statistic.sampleId == sample.guid && statistic.symbol == isotope.symbol).First();
					r1[isotope.symbol] = stat.avgCPS;
					r2[isotope.symbol] = stat.sdCPS;
					r3[isotope.symbol] = stat.rsdCPS;
				}
			}
			dtAnalyteICPSSingle.Rows.Add(r1);
			dtAnalyteICPSSingle.Rows.Add(r2);
			dtAnalyteICPSSingle.Rows.Add(r3);
		}
		catch (Exception ex)
		{
			Log.InsertLog(Lang.Txt("AddFormNumerics.ConcentrationDisplay"), Lang.Txt("AddFormNumerics.IncorrectDisplay"), ex.Message, (Severity)3);
		}
	}

	private void SetupAnalyteCPSHeaderForSingleSample()
	{
		dtAnalyteICPSSingle.Columns.Clear();
		dtAnalyteICPSSingle.Columns.Add("sample");
		DataColumn column = dtAnalyteICPSSingle.Columns.Add("header");
		column.ColumnMapping = MappingType.Hidden;
		foreach (IsotopeInfos isotope in experiment.Isotopes)
		{
			if (!isotope.isInterference && isotope.visible)
			{
				DataColumn dc = dtAnalyteICPSSingle.Columns.Add(isotope.symbol, typeof(double));
				if (isotope.inter)
				{
					dc.ExtendedProperties.Add(true, true);
				}
				else
				{
					dc.ExtendedProperties.Clear();
				}
			}
		}
	}

	private void InitAnalyteICPSForSingle(SamplesInfos sample)
	{
		int firstRow = ((DataGridView)(object)rowMergeView2).FirstDisplayedScrollingRowIndex;
		firstRow = ((firstRow != -1) ? firstRow : 0);
		int firstCol = ((DataGridView)(object)rowMergeView2).FirstDisplayedScrollingColumnIndex;
		firstCol = ((firstCol != -1) ? firstCol : 0);
		((Control)(object)rowMergeView2).Tag = sample.guid;
		((DataGridView)(object)rowMergeView2).Columns.Clear();
		SetupAnalyteCPSHeaderForSingleSample();
		SetupAnalyteICPSDatasForSingleSample(sample);
		((DataGridView)(object)rowMergeView2).Columns.Add("sample", Lang.Txt("FormNumerics.Columns.SampleName.Text"));
		foreach (IsotopeInfos isotope in experiment.Isotopes)
		{
			if (!isotope.isInterference && isotope.visible)
			{
				DataGridViewColumn col = new DataGridViewColumn();
				col.Name = isotope.symbol;
				col.HeaderText = isotope.symbol;
				col.ValueType = typeof(double);
				col.CellTemplate = new DataGridViewTextBoxCell();
				((DataGridView)(object)rowMergeView2).Columns.Add(col);
			}
		}
		foreach (IsotopeInfos isotope2 in experiment.Isotopes)
		{
			if (isotope2.visible && !isotope2.isInterference)
			{
				if (isotope2.inter && ((DataGridView)(object)rowMergeView2).Columns.Contains(isotope2.symbol))
				{
					((DataGridView)(object)rowMergeView2).Columns[isotope2.symbol].DefaultCellStyle.BackColor = Color.Yellow;
				}
				else
				{
					((DataGridView)(object)rowMergeView2).Columns[isotope2.symbol].DefaultCellStyle.BackColor = Color.FromKnownColor(KnownColor.Control);
				}
			}
		}
		((DataGridView)(object)rowMergeView2).Columns["sample"].HeaderText = Lang.Txt("FormNumerics.Columns.SampleName.Text");
		((DataGridView)(object)rowMergeView2).Columns["sample"].Width = 90;
		((DataGridView)(object)rowMergeView2).Columns["sample"].Frozen = true;
		foreach (DataGridViewColumn column in ((DataGridView)(object)rowMergeView2).Columns)
		{
			column.SortMode = DataGridViewColumnSortMode.NotSortable;
		}
		((DataGridView)(object)rowMergeView2).RowCount = dtAnalyteICPSSingle.Rows.Count;
		for (int j = 0; j < ((DataGridView)(object)rowMergeView2).Rows.Count; j++)
		{
			((DataGridView)(object)rowMergeView2).Rows[j].HeaderCell.Value = dtAnalyteICPSSingle.Rows[j]["header"];
			((DataGridView)(object)rowMergeView2).RowHeadersWidth = 60;
		}
		int rowCount = GetDataGridViewVisableRowCount((DataGridView)(object)rowMergeView2);
		int ColCount = GetDataGridViewVisableColumnCount((DataGridView)(object)rowMergeView2);
		((Control)(object)rowMergeView2).SuspendLayout();
		if (firstCol != 0 && ((DataGridView)(object)rowMergeView2).Columns.Count > firstCol)
		{
			((DataGridView)(object)rowMergeView2).FirstDisplayedScrollingColumnIndex = firstCol;
		}
		if (firstRow != 0 && ((DataGridView)(object)rowMergeView2).Rows.Count > firstRow)
		{
			((DataGridView)(object)rowMergeView2).FirstDisplayedScrollingRowIndex = firstRow;
		}
		for (int i = firstRow; i <= firstRow + rowCount - 1; i++)
		{
			for (int k = firstCol; k <= firstCol + ColCount - 1; k++)
			{
				if (i < ((DataGridView)(object)rowMergeView2).Rows.Count && k < ((DataGridView)(object)rowMergeView2).Columns.Count)
				{
					((DataGridView)(object)rowMergeView2).InvalidateCell(((DataGridView)(object)rowMergeView2).Rows[i].Cells[k]);
				}
			}
		}
		((Control)(object)rowMergeView2).ResumeLayout();
	}

	private void InitRatios()
	{
		((Control)(object)dgvRatio).SuspendLayout();
		int firstRow = ((DataGridView)(object)dgvRatio).FirstDisplayedScrollingRowIndex;
		firstRow = ((firstRow != -1) ? firstRow : 0);
		int firstCol = ((DataGridView)(object)dgvRatio).FirstDisplayedScrollingColumnIndex;
		firstCol = ((firstCol != -1) ? firstCol : 0);
		((DataGridView)(object)dgvRatio).Columns.Clear();
		((DataGridView)(object)dgvRatio).Columns.Add("sample", Lang.Txt("FormNumerics.Columns.SampleName.Text"));
		((DataGridView)(object)dgvRatio).Columns["sample"].Tag = false;
		foreach (IsotopeRatio ratio in experiment.Ratios)
		{
			DataGridViewColumn col = new DataGridViewColumn();
			col.Name = ratio.Name;
			col.HeaderText = ratio.Name;
			col.ValueType = typeof(double);
			col.CellTemplate = new DataGridViewTextBoxCell();
			((DataGridView)(object)dgvRatio).Columns.Add(col);
		}
		foreach (IsotopeRatio ratio2 in experiment.Ratios)
		{
			if (((DataGridView)(object)dgvRatio).Columns.Contains(ratio2.Name))
			{
				((DataGridView)(object)dgvRatio).Columns[ratio2.Name].DefaultCellStyle.BackColor = Color.FromKnownColor(KnownColor.Control);
			}
		}
		((DataGridView)(object)dgvRatio).Columns["sample"].HeaderText = Lang.Txt("FormNumerics.Columns.SampleName.Text");
		((DataGridView)(object)dgvRatio).Columns["sample"].Width = 90;
		((DataGridView)(object)dgvRatio).Columns["sample"].Frozen = true;
		foreach (DataGridViewColumn column in ((DataGridView)(object)dgvRatio).Columns)
		{
			column.SortMode = DataGridViewColumnSortMode.NotSortable;
		}
		int rowcount = experiment.Samples.FindAll((SamplesInfos r) => r.report && r.status != 0).Count();
		((DataGridView)(object)dgvRatio).RowCount = (experiment.ReportParams.ShowRsd ? (rowcount * 2) : rowcount);
		for (int j = 0; j < ((DataGridView)(object)dgvRatio).Rows.Count; j++)
		{
			((DataGridView)(object)dgvRatio).Rows[j].HeaderCell.Value = "";
			((DataGridView)(object)dgvRatio).RowHeadersWidth = 60;
		}
		int rowCount = GetDataGridViewVisableRowCount((DataGridView)(object)dgvRatio);
		int ColCount = GetDataGridViewVisableColumnCount((DataGridView)(object)dgvRatio);
		((Control)(object)dgvRatio).SuspendLayout();
		if (firstCol != 0 && ((DataGridView)(object)dgvRatio).Columns.Count > firstCol)
		{
			((DataGridView)(object)dgvRatio).FirstDisplayedScrollingColumnIndex = firstCol;
		}
		if (firstRow != 0 && ((DataGridView)(object)dgvRatio).Rows.Count > firstRow)
		{
			((DataGridView)(object)dgvRatio).FirstDisplayedScrollingRowIndex = firstRow;
		}
		for (int i = firstRow; i <= firstRow + rowCount - 1; i++)
		{
			for (int k = firstCol; k <= firstCol + ColCount - 1; k++)
			{
				if (i < ((DataGridView)(object)dgvRatio).Rows.Count && k < ((DataGridView)(object)dgvRatio).Columns.Count)
				{
					((DataGridView)(object)dgvRatio).InvalidateCell(((DataGridView)(object)dgvRatio).Rows[i].Cells[k]);
				}
			}
		}
		((Control)(object)dgvRatio).ResumeLayout();
	}

	private void InitRatios1()
	{
		int firstRow = ((DataGridView)(object)dgvRatio).FirstDisplayedScrollingRowIndex;
		firstRow = ((firstRow != -1) ? firstRow : 0);
		int firstCol = ((DataGridView)(object)dgvRatio).FirstDisplayedScrollingColumnIndex;
		firstCol = ((firstCol != -1) ? firstCol : 0);
		((DataGridView)(object)dgvRatio).Columns.Clear();
		SetupRatioHeader();
		SetupRatioDatas();
		((DataGridView)(object)dgvRatio).Columns.Add("sample", Lang.Txt("FormNumerics.Columns.SampleName.Text"));
		foreach (IsotopeRatio ratio2 in experiment.Ratios)
		{
			DataGridViewColumn col = new DataGridViewColumn();
			col.Name = ratio2.Name;
			col.HeaderText = ratio2.Name;
			col.ValueType = typeof(double);
			col.CellTemplate = new DataGridViewTextBoxCell();
			((DataGridView)(object)dgvRatio).Columns.Add(col);
		}
		foreach (IsotopeRatio ratio in experiment.Ratios)
		{
			if (((DataGridView)(object)dgvRatio).Columns.Contains(ratio.Name))
			{
				((DataGridView)(object)dgvRatio).Columns[ratio.Name].DefaultCellStyle.BackColor = Color.FromKnownColor(KnownColor.Control);
			}
		}
		((DataGridView)(object)dgvRatio).Columns["sample"].HeaderText = Lang.Txt("FormNumerics.Columns.SampleName.Text");
		((DataGridView)(object)dgvRatio).Columns["sample"].Width = 90;
		((DataGridView)(object)dgvRatio).Columns["sample"].Frozen = true;
		foreach (DataGridViewColumn column in ((DataGridView)(object)dgvRatio).Columns)
		{
			column.SortMode = DataGridViewColumnSortMode.NotSortable;
		}
		((DataGridView)(object)dgvRatio).RowCount = dtRatio.Rows.Count;
		for (int j = 0; j < ((DataGridView)(object)dgvRatio).Rows.Count; j++)
		{
			((DataGridView)(object)dgvRatio).Rows[j].HeaderCell.Value = "";
			((DataGridView)(object)dgvRatio).RowHeadersWidth = 60;
		}
		int rowCount = GetDataGridViewVisableRowCount((DataGridView)(object)dgvRatio);
		int ColCount = GetDataGridViewVisableColumnCount((DataGridView)(object)dgvRatio);
		((Control)(object)dgvRatio).SuspendLayout();
		if (firstCol != 0 && ((DataGridView)(object)dgvRatio).Columns.Count > firstCol)
		{
			((DataGridView)(object)dgvRatio).FirstDisplayedScrollingColumnIndex = firstCol;
		}
		if (firstRow != 0 && ((DataGridView)(object)dgvRatio).Rows.Count > firstRow)
		{
			((DataGridView)(object)dgvRatio).FirstDisplayedScrollingRowIndex = firstRow;
		}
		for (int i = firstRow; i <= firstRow + rowCount - 1; i++)
		{
			for (int k = firstCol; k <= firstCol + ColCount - 1; k++)
			{
				if (i < ((DataGridView)(object)dgvRatio).Rows.Count && k < ((DataGridView)(object)dgvRatio).Columns.Count)
				{
					((DataGridView)(object)dgvRatio).InvalidateCell(((DataGridView)(object)dgvRatio).Rows[i].Cells[k]);
				}
			}
		}
		((Control)(object)dgvRatio).ResumeLayout();
	}

	private void SetupRatioHeader()
	{
		dtRatio.Columns.Clear();
		dtRatio.Columns.Add("sample");
		DataColumn column = dtRatio.Columns.Add("header");
		column.ColumnMapping = MappingType.Hidden;
		foreach (IsotopeRatio isotope in experiment.Ratios)
		{
			dtRatio.Columns.Add(isotope.Name, typeof(double));
		}
	}

	private void SetupRatioDatas()
	{
		dtRatio.Rows.Clear();
		foreach (SamplesInfos sample in experiment.Samples)
		{
			if (sample.status == 0 || !sample.report)
			{
				continue;
			}
			DataRow rowEmpty = dtRatio.NewRow();
			rowEmpty["header"] = "";
			rowEmpty["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
			foreach (IsotopeRatio isotope2 in experiment.Ratios)
			{
				rowEmpty[isotope2.Name] = -1;
			}
			DataRow r1 = dtRatio.NewRow();
			r1["header"] = "χ";
			r1["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
			DataRow r2 = dtRatio.NewRow();
			r2["header"] = "%RSD";
			r2["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
			foreach (IsotopeRatio isotope in experiment.Ratios)
			{
				RatioStatistics stat = experiment.RatioStat.Where((RatioStatistics statistic) => statistic.SampleId == sample.guid && statistic.Name == isotope.Name).First();
				r1[isotope.Name] = stat.Avg;
				r2[isotope.Name] = stat.Rsd;
			}
			if (experiment.ReportParams.ShowMean)
			{
				dtRatio.Rows.Add(r1);
			}
			if (experiment.ReportParams.ShowRsd)
			{
				dtRatio.Rows.Add(r2);
			}
		}
	}

	private void InitRatiosForSingle(SamplesInfos sample)
	{
		int firstRow = ((DataGridView)(object)rowMergeView3).FirstDisplayedScrollingRowIndex;
		firstRow = ((firstRow != -1) ? firstRow : 0);
		int firstCol = ((DataGridView)(object)rowMergeView3).FirstDisplayedScrollingColumnIndex;
		firstCol = ((firstCol != -1) ? firstCol : 0);
		((DataGridView)(object)rowMergeView3).Columns.Clear();
		SetupRatioHeaderForSingle();
		SetupRatioDatasForSingle(sample);
		((DataGridView)(object)rowMergeView3).Columns.Add("sample", Lang.Txt("FormNumerics.Columns.SampleName.Text"));
		foreach (IsotopeRatio ratio in experiment.Ratios)
		{
			DataGridViewColumn col = new DataGridViewColumn();
			col.Name = ratio.Name;
			col.HeaderText = ratio.Name;
			col.ValueType = typeof(double);
			col.CellTemplate = new DataGridViewTextBoxCell();
			((DataGridView)(object)rowMergeView3).Columns.Add(col);
		}
		foreach (IsotopeRatio ratio2 in experiment.Ratios)
		{
			if (((DataGridView)(object)rowMergeView3).Columns.Contains(ratio2.Name))
			{
				((DataGridView)(object)rowMergeView3).Columns[ratio2.Name].DefaultCellStyle.BackColor = Color.FromKnownColor(KnownColor.Control);
			}
		}
		((DataGridView)(object)rowMergeView3).Columns["sample"].HeaderText = Lang.Txt("FormNumerics.Columns.SampleName.Text");
		((DataGridView)(object)rowMergeView3).Columns["sample"].Width = 90;
		((DataGridView)(object)rowMergeView3).Columns["sample"].Frozen = true;
		foreach (DataGridViewColumn column in ((DataGridView)(object)rowMergeView3).Columns)
		{
			column.SortMode = DataGridViewColumnSortMode.NotSortable;
		}
		((DataGridView)(object)rowMergeView3).RowCount = dtRatioSingle.Rows.Count;
		for (int k = 0; k < ((DataGridView)(object)rowMergeView3).Rows.Count; k++)
		{
			((DataGridView)(object)rowMergeView3).Rows[k].HeaderCell.Value = "";
			((DataGridView)(object)rowMergeView3).RowHeadersWidth = 60;
		}
		int rowCount = GetDataGridViewVisableRowCount((DataGridView)(object)rowMergeView3);
		int ColCount = GetDataGridViewVisableColumnCount((DataGridView)(object)rowMergeView3);
		((Control)(object)rowMergeView3).SuspendLayout();
		if (firstCol != 0 && ((DataGridView)(object)rowMergeView3).Columns.Count > firstCol)
		{
			((DataGridView)(object)rowMergeView3).FirstDisplayedScrollingColumnIndex = firstCol;
		}
		if (firstRow != 0 && ((DataGridView)(object)rowMergeView3).Rows.Count > firstRow)
		{
			((DataGridView)(object)rowMergeView3).FirstDisplayedScrollingRowIndex = firstRow;
		}
		for (int j = firstRow; j <= firstRow + rowCount - 1; j++)
		{
			for (int l = firstCol; l <= firstCol + ColCount - 1; l++)
			{
				if (j < ((DataGridView)(object)rowMergeView3).Rows.Count && l < ((DataGridView)(object)rowMergeView3).Columns.Count)
				{
					((DataGridView)(object)rowMergeView3).InvalidateCell(((DataGridView)(object)rowMergeView3).Rows[j].Cells[l]);
				}
			}
		}
		((Control)(object)rowMergeView3).ResumeLayout();
		for (int i = 0; i < ((DataGridView)(object)rowMergeView3).Rows.Count; i++)
		{
			((DataGridView)(object)rowMergeView3).Rows[i].HeaderCell.Value = dtRatioSingle.Rows[i]["header"];
			((DataGridView)(object)rowMergeView3).RowHeadersWidth = 60;
		}
	}

	private void SetupRatioHeaderForSingle()
	{
		dtRatioSingle.Columns.Clear();
		dtRatioSingle.Columns.Add("sample");
		DataColumn column = dtRatioSingle.Columns.Add("header");
		column.ColumnMapping = MappingType.Hidden;
		foreach (IsotopeRatio isotope in experiment.Ratios)
		{
			dtRatioSingle.Columns.Add(isotope.Name, typeof(double));
		}
	}

	private void SetupRatioDatasForSingle(SamplesInfos sample)
	{
		dtRatioSingle.Rows.Clear();
		if (sample.status == 0 || !sample.report)
		{
			return;
		}
		DataRow rowEmpty = dtRatioSingle.NewRow();
		rowEmpty["header"] = "";
		rowEmpty["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
		foreach (IsotopeRatio isotope3 in experiment.Ratios)
		{
			rowEmpty[isotope3.Name] = -1;
		}
		for (int i = 0; i < sample.mains; i++)
		{
			DataRow row = dtRatioSingle.NewRow();
			row["header"] = i + 1;
			row["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
			foreach (IsotopeRatio isotope2 in experiment.Ratios)
			{
				IEnumerable<RatioResults> value = experiment.RatioResults.Where((RatioResults result) => result.SampleId == sample.guid && result.Name == isotope2.Name && result.Number == i);
				row[isotope2.Name] = value.First().CaliResult;
			}
			dtRatioSingle.Rows.Add(row);
		}
		DataRow r1 = dtRatioSingle.NewRow();
		r1["header"] = "χ";
		r1["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
		DataRow r2 = dtRatioSingle.NewRow();
		r2["header"] = "σ";
		r2["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
		DataRow r3 = dtRatioSingle.NewRow();
		r3["header"] = "%RSD";
		r3["sample"] = sample.label + "\n" + sample.time.ToString("dd/MM HH:mm");
		foreach (IsotopeRatio isotope in experiment.Ratios)
		{
			RatioStatistics stat = experiment.RatioStat.Where((RatioStatistics statistic) => statistic.SampleId == sample.guid && statistic.Name == isotope.Name).First();
			r1[isotope.Name] = stat.CaliAvg;
			r2[isotope.Name] = stat.Sd;
			r3[isotope.Name] = stat.Rsd;
		}
		dtRatioSingle.Rows.Add(r1);
		dtRatioSingle.Rows.Add(r2);
		dtRatioSingle.Rows.Add(r3);
	}

	private void FormNumerics_Load(object sender, EventArgs e)
	{
		FormatValue.numberformat.NumberDecimalDigits = (int)Settings.Default.DecimalPlaces;
		base.WindowState = FormWindowState.Maximized;
		ApplyResources();
		panel1.Parent = null;
		panel2.Dock = DockStyle.Fill;
		panel3.Parent = null;
		panel4.Dock = DockStyle.Fill;
		panel5.Parent = null;
		panel6.Dock = DockStyle.Fill;
		Task.Factory.StartNew(delegate
		{
			RefreshResults();
		});
		PermissionManagement();
		UserManager.UserChanged += UserManager_UserChanged;
		experiment.ratioChanged += Experiment_ratioChanged;
		FormExperiment form = (FormExperiment)base.ParentForm.ParentForm;
		form.analyseFinish += experiment_EventExperiment;
		tsbtnSaveResult.DefaultItem = tsmiCONC;
	}

	private void Experiment_ratioChanged(object sender, EventArgs e)
	{
		RefreshResults();
	}

	private void experiment_EventExperiment(object sendeer, EventArgs e)
	{
		try
		{
			Invoke((MethodInvoker)delegate
			{
				tsbtnRefresh.Enabled = false;
				experiment.switchPA = experiment.UsePA != toolStripComboBoxPA.SelectedIndex;
				experiment.UsePA = toolStripComboBoxPA.SelectedIndex;
				if (Detector.detectorConfig.IsNewBoard)
				{
					experiment.RecalculatedAllForNew();
				}
				else
				{
					experiment.RecalculatedAll(experiment.UsePA);
				}
				experiment.switchPA = false;
				experiment.OnRefreshChanged();
				RefreshResults();
				tsbtnRefresh.Enabled = true;
			});
		}
		catch (Exception ex)
		{
			Log.InsertLog(Lang.Txt("AddFormNumerics.RefreshData"), Lang.Txt("AddFormNumerics.RefreshData"), ex.Message, (Severity)3);
		}
	}

	private void UserManager_UserChanged(object sender, EventArgs e)
	{
		PermissionManagement();
	}

	private void PermissionManagement()
	{
		try
		{
			if (toolStripComboBoxPA != null)
			{
				if (UserManager.CurrentUser.authority <= 1)
				{
					toolStripComboBoxPA.Visible = false;
				}
				else
				{
					toolStripComboBoxPA.Visible = true;
				}
			}
		}
		catch
		{
		}
	}

	private void ApplyResources()
	{
		tsbtnDatas.Text = Lang.Txt("FormNumerics.Edit.Text");
		tsbtnRefresh.Text = Lang.Txt("FormNumerics.Refresh.Text");
		tsbtnSaveResult.Text = Lang.Txt("FormNumerics.Save.Text");
		tsmiCONC.Text = Lang.Txt("FormNumerics.Concentration.Text");
		tsmiCPS.Text = Lang.Txt("FormNumerics.CaliIntensity.Text");
		tsmiUCPS.Text = Lang.Txt("FormNumerics.OriIntensity.Text");
		pageAnalyteConcentration.Text = Lang.Txt("FormNumerics.Concentration.Text");
		pageAnalyteICPS.Text = Lang.Txt("FormNumerics.CaliIntensity.Text");
		pageRatio.Text = Lang.Txt("FormNumerics.Ratio.Text");
		pageUncorrectICPS.Text = Lang.Txt("FormNumerics.OriIntensity.Text");
		toolStripButtonExport.Text = Lang.Txt("AddFormNumerics.Export");
		toolStripComboBoxPA.Items[0] = Lang.Txt("AddFormNumerics.CorrectionWithPA");
		toolStripComboBoxPA.Items[1] = Lang.Txt("AddFormNumerics.UsePCOnly");
		toolStripComboBoxPA.Items[2] = Lang.Txt("AddFormNumerics.UseAnalogOnly");
	}

	private void RecalculatedAll()
	{
		if (Detector.detectorConfig.IsNewBoard)
		{
			experiment.RecalculatedAllForNew();
		}
		else
		{
			experiment.RecalculatedAll();
		}
	}

	private void tsbtnRefresh_Click(object sender, EventArgs e)
	{
		tsbtnRefresh.Enabled = false;
		FormWait wait = new FormWait();
		wait.StartPosition = FormStartPosition.CenterParent;
		wait.Text = Lang.Txt("FormNumerics.Calculate.Text");
		wait.Run += CalculateRun;
		wait.Complete += CalculateComplete;
		wait.Show();
	}

	private void CalculateRun(object sender, ExpDataArgs e)
	{
		ProgressBar bar = sender as ProgressBar;
		if (bar != null)
		{
			Invoke((MethodInvoker)delegate
			{
				bar.Style = ProgressBarStyle.Marquee;
				try
				{
					experiment.switchPA = experiment.UsePA != toolStripComboBoxPA.SelectedIndex;
					experiment.UsePA = toolStripComboBoxPA.SelectedIndex;
				}
				catch (Exception ex)
				{
					Console.WriteLine(ex.Message);
				}
			});
		}
		if (Detector.detectorConfig.IsNewBoard)
		{
			experiment.RecalculatedAllForNew(experiment.UsePA);
		}
		else
		{
			experiment.RecalculatedAll(experiment.UsePA);
		}
		experiment.switchPA = false;
		experiment.OnRefreshChanged();
	}

	private void CalculateComplete(object sender, EventArgs e)
	{
		Invoke((MethodInvoker)delegate
		{
			(sender as Form).Text = Lang.Txt("FormNumerics.RefreshData.Text");
			RefreshResults();
			tsbtnRefresh.Enabled = true;
		});
	}

	public void RefreshResults()
	{
		Invoke((MethodInvoker)delegate
		{
			if (!isInRefresh)
			{
				isInRefresh = true;
				try
				{
					InitConcentration();
					if (((Control)(object)dataGridView1).Tag != null)
					{
						InitConcentrationForSingle(experiment.Samples.Find((SamplesInfos r) => r.guid == (int)((Control)(object)dataGridView1).Tag));
					}
				}
				catch (Exception)
				{
				}
				try
				{
					InitAnalyteICPS();
					if (((Control)(object)rowMergeView1).Tag != null)
					{
						InitAnalyteICPSForSingle(experiment.Samples.Find((SamplesInfos r) => r.guid == (int)((Control)(object)rowMergeView1).Tag));
					}
				}
				catch (Exception)
				{
				}
				try
				{
					InitUncorrectedICPS();
					if (((Control)(object)rowMergeView2).Tag != null)
					{
						InitUncorrectCPSForSingle(experiment.Samples.Find((SamplesInfos r) => r.guid == (int)((Control)(object)rowMergeView2).Tag));
					}
				}
				catch (Exception)
				{
				}
				try
				{
					InitRatios();
					if (((Control)(object)rowMergeView3).Tag != null)
					{
						InitRatiosForSingle(experiment.Samples.Find((SamplesInfos r) => r.guid == (int)((Control)(object)rowMergeView3).Tag));
					}
				}
				catch (Exception)
				{
				}
				isInRefresh = false;
			}
		});
	}

	public void RefreshResultsSingle(SamplesInfos sample)
	{
		Invoke((MethodInvoker)delegate
		{
			if (!isInRefresh)
			{
				isInRefresh = true;
				try
				{
					List<SamplesInfos> list = experiment.Samples.FindAll((SamplesInfos r) => r.report && r.status != 0);
					int num = list.FindIndex((SamplesInfos r) => r.guid == sample.guid);
					if (num >= 0)
					{
						if (experiment.ReportParams.ShowRsd)
						{
							((DataGridView)(object)dgvAnalyteConcentrations).InvalidateRow(num * 2);
							((DataGridView)(object)dgvAnalyteConcentrations).InvalidateRow(num * 2 + 1);
							((DataGridView)(object)dgvAnalyteICPS).InvalidateRow(num * 2);
							((DataGridView)(object)dgvAnalyteICPS).InvalidateRow(num * 2 + 1);
							((DataGridView)(object)dgvUncorrectedICPS).InvalidateRow(num * 2);
							((DataGridView)(object)dgvUncorrectedICPS).InvalidateRow(num * 2 + 1);
						}
						else
						{
							((DataGridView)(object)dgvAnalyteConcentrations).InvalidateRow(num);
							((DataGridView)(object)dgvAnalyteICPS).InvalidateRow(num);
							((DataGridView)(object)dgvUncorrectedICPS).InvalidateRow(num);
						}
						if (((Control)(object)dataGridView1).Tag != null)
						{
							InitConcentrationForSingle(experiment.Samples.Find((SamplesInfos r) => r.guid == (int)((Control)(object)dataGridView1).Tag));
						}
						if (((Control)(object)rowMergeView1).Tag != null)
						{
							InitAnalyteICPSForSingle(experiment.Samples.Find((SamplesInfos r) => r.guid == (int)((Control)(object)rowMergeView1).Tag));
						}
						if (((Control)(object)rowMergeView2).Tag != null)
						{
							InitUncorrectCPSForSingle(experiment.Samples.Find((SamplesInfos r) => r.guid == (int)((Control)(object)rowMergeView2).Tag));
						}
						if (((Control)(object)rowMergeView3).Tag != null)
						{
							InitRatiosForSingle(experiment.Samples.Find((SamplesInfos r) => r.guid == (int)((Control)(object)rowMergeView3).Tag));
						}
					}
				}
				catch (Exception)
				{
				}
				isInRefresh = false;
			}
		});
	}

	private void dgvAnalyteConcentrations_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
	{
	}

	private void dgvUncorrectedICPS_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
	{
	}

	private void dgvAnalyteICPS_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
	{
	}

	private void dgvUncorrectedICPS_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
	{
		if (e.ColumnIndex <= 0)
		{
			return;
		}
		if (e.Value.Equals(-1))
		{
			e.Value = null;
		}
		else
		{
			e.Value = string.Format(new FormatValue(), "{0:U}", e.Value);
		}
		if ((experiment.ReportParams.ShowRsd && e.RowIndex % 2 == 0) || !experiment.ReportParams.ShowRsd)
		{
			e.CellStyle.ForeColor = Color.Blue;
			e.CellStyle.Font = new System.Drawing.Font(new FontFamily("SimSun"), 9f, FontStyle.Bold);
			return;
		}
		e.CellStyle.ForeColor = Color.Blue;
		if (CheckRsdColor(e.Value))
		{
			e.CellStyle.BackColor = rsdOutColor;
		}
	}

	private bool CheckRsdColor(object ee)
	{
		if (ee.ToString() == "***")
		{
			return false;
		}
		if (ee.ToString() == "")
		{
			return false;
		}
		try
		{
			double value = double.Parse(ee.ToString());
			if (value >= 10.0)
			{
				return true;
			}
			return false;
		}
		catch (Exception)
		{
			return false;
		}
	}

	private void dgvAnalyteConcentrations_CellFormattingbak(object sender, DataGridViewCellFormattingEventArgs e)
	{
		if (e.ColumnIndex <= 0)
		{
			return;
		}
		if (dtConcentration.Columns[e.ColumnIndex + 1].ExtendedProperties.ContainsKey(true) && dtConcentration.Rows[e.RowIndex]["header"].ToString() != "%RSD")
		{
			e.Value = string.Format(new FormatPercent(), "{0:U}", e.Value);
		}
		else
		{
			e.Value = string.Format(new FormatValue(), "{0:U}", e.Value);
		}
		if (dtConcentration.Rows[e.RowIndex]["header"].ToString() == "χ")
		{
			e.CellStyle.ForeColor = Color.Blue;
			e.CellStyle.Font = new System.Drawing.Font(new FontFamily("SimSun"), 9f, FontStyle.Bold);
		}
		else if (dtConcentration.Rows[e.RowIndex]["header"].ToString() == "σ")
		{
			e.CellStyle.ForeColor = Color.Blue;
		}
		else if (dtConcentration.Rows[e.RowIndex]["header"].ToString() == "%RSD")
		{
			e.CellStyle.ForeColor = Color.Blue;
			if (CheckRsdColor(e.Value))
			{
				e.CellStyle.BackColor = rsdOutColor;
			}
		}
	}

	private void dgvAnalyteConcentrations_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
	{
		if (e.ColumnIndex <= 0)
		{
			return;
		}
		if (Convert.ToBoolean(((DataGridView)(object)dgvAnalyteConcentrations).Columns[e.ColumnIndex].Tag) && ((experiment.ReportParams.ShowRsd && e.RowIndex % 2 == 0) || !experiment.ReportParams.ShowRsd))
		{
			e.Value = string.Format(new FormatPercent(), "{0:U}", e.Value);
		}
		else
		{
			e.Value = string.Format(new FormatValue(), "{0:U}", e.Value);
		}
		if ((experiment.ReportParams.ShowRsd && e.RowIndex % 2 == 0) || !experiment.ReportParams.ShowRsd)
		{
			e.CellStyle.ForeColor = Color.Blue;
			e.CellStyle.Font = new System.Drawing.Font(new FontFamily("SimSun"), 9f, FontStyle.Bold);
			return;
		}
		e.CellStyle.ForeColor = Color.Blue;
		if (CheckRsdColor(e.Value))
		{
			e.CellStyle.BackColor = rsdOutColor;
		}
	}

	private void dgvAnalyteICPS_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
	{
		if (e.ColumnIndex <= 0)
		{
			return;
		}
		if (Convert.ToBoolean(((DataGridView)(object)dgvAnalyteICPS).Columns[e.ColumnIndex].Tag) && ((experiment.ReportParams.ShowRsd && e.RowIndex % 2 == 0) || !experiment.ReportParams.ShowRsd))
		{
			e.Value = string.Format(new FormatPercent(), "{0:U}", e.Value);
		}
		else
		{
			e.Value = string.Format(new FormatValue(), "{0:U}", e.Value);
		}
		if ((experiment.ReportParams.ShowRsd && e.RowIndex % 2 == 0) || !experiment.ReportParams.ShowRsd)
		{
			e.CellStyle.ForeColor = Color.Blue;
			e.CellStyle.Font = new System.Drawing.Font(new FontFamily("SimSun"), 9f, FontStyle.Bold);
			return;
		}
		e.CellStyle.ForeColor = Color.Blue;
		if (CheckRsdColor(e.Value))
		{
			e.CellStyle.BackColor = rsdOutColor;
		}
	}

	private void tsmiUCPS_Click(object sender, EventArgs e)
	{
		SaveFileDialog dlg = new SaveFileDialog();
		dlg.Title = Lang.Txt("FormNumerics.SaveOriIntensity.Text");
		dlg.Filter = "Csv File(*.csv)|*.csv";
		if (dlg.ShowDialog() == DialogResult.OK)
		{
			string filename = dlg.FileName;
			ExportResults(filename, 1);
		}
	}

	private void tsmiCPS_Click(object sender, EventArgs e)
	{
		SaveFileDialog dlg = new SaveFileDialog();
		dlg.Title = Lang.Txt("FormNumerics.SaveCaliIntensity.Text");
		dlg.Filter = "Csv File(*.csv)|*.csv";
		if (dlg.ShowDialog() == DialogResult.OK)
		{
			string filename = dlg.FileName;
			ExportResults(filename, 2);
		}
	}

	private void tsmiCONC_Click(object sender, EventArgs e)
	{
		SaveFileDialog dlg = new SaveFileDialog();
		dlg.Title = Lang.Txt("FormNumerics.SaveConcentration.Text");
		dlg.Filter = "Csv File(*.csv)|*.csv";
		if (dlg.ShowDialog() == DialogResult.OK)
		{
			string filename = dlg.FileName;
			ExportResults(filename, 0);
		}
	}

	private void ExportExcel(string saveFileName, bool showConc, bool showUcps, bool showIcps, bool showRatio)
	{
		string fileName = Path.GetFileNameWithoutExtension(saveFileName);
		if (saveFileName.IndexOf(":") < 0)
		{
			return;
		}
		Microsoft.Office.Interop.Excel.Application xlApp = (Microsoft.Office.Interop.Excel.Application)Activator.CreateInstance(Marshal.GetTypeFromCLSID(new Guid("00024500-0000-0000-C000-000000000046")));
		if (xlApp == null)
		{
			MessageBox.Show(Lang.Txt("AddFormNumerics.UnableCreate"));
			return;
		}
		Workbooks workbooks = xlApp.Workbooks;
		Workbook workbook = workbooks.Add(XlWBATemplate.xlWBATWorksheet);
		object misValue = Missing.Value;
		Worksheet worksheet = (Worksheet)(dynamic)workbook.Worksheets[1];
		worksheet.Name = "DefaultSheet";
		if (showRatio)
		{
			if (worksheet.Name != "DefaultSheet")
			{
				worksheet = (Worksheet)(dynamic)workbook.Worksheets.Add(worksheet, misValue, misValue, misValue);
			}
			worksheet.Name = Lang.Txt("AddFormNumerics.Ratio");
			EditSheet(dgvRatio, worksheet, dtRatio);
		}
		if (showIcps)
		{
			if (worksheet.Name != "DefaultSheet")
			{
				worksheet = (Worksheet)(dynamic)workbook.Worksheets.Add(worksheet, misValue, misValue, misValue);
			}
			worksheet.Name = Lang.Txt("AddFormNumerics.CalculateIntensity");
			EditSheet(dgvAnalyteICPS, worksheet);
		}
		if (showUcps)
		{
			if (worksheet.Name != "DefaultSheet")
			{
				worksheet = (Worksheet)(dynamic)workbook.Worksheets.Add(worksheet, misValue, misValue, misValue);
			}
			worksheet.Name = Lang.Txt("AddFormNumerics.OriginalIntensity");
			EditSheet(dgvUncorrectedICPS, worksheet, IsOriginal: true);
		}
		if (showConc)
		{
			if (worksheet.Name != "DefaultSheet")
			{
				worksheet = (Worksheet)(dynamic)workbook.Worksheets.Add(worksheet, misValue, misValue, misValue);
			}
			worksheet.Name = Lang.Txt("AddFormNumerics.Concentration");
			EditSheet(dgvAnalyteConcentrations, worksheet);
		}
		if (saveFileName != "")
		{
			try
			{
				workbook.Saved = true;
				workbook.SaveCopyAs(saveFileName);
			}
			catch (Exception ex)
			{
				MessageBox.Show(Lang.Txt("AddFormNumerics.ErrorExportingFile") + ex.Message);
				xlApp.Quit();
				GC.Collect();
				return;
			}
		}
		xlApp.Quit();
		GC.Collect();
		Process.Start(saveFileName);
	}

	private void EditSheet(RowMergeView rmv, Worksheet worksheet, DataTable dt)
	{
		for (int i = 0; i < ((DataGridView)(object)rmv).Columns.Count; i++)
		{
			worksheet.Cells[1, 2 + i] = ((DataGridView)(object)rmv).Columns[i].HeaderText;
		}
		for (int j = 0; j < ((DataGridView)(object)rmv).Rows.Count; j++)
		{
			worksheet.Cells[2 + j, 1] = dtRatio.Rows[j]["header"];
		}
		int l = 0;
		while (l < ((DataGridView)(object)rmv).Rows.Count)
		{
			int StartIndex = l;
			int EndIndex = l;
			string rangeValue = ((DataGridView)(object)rmv).Rows[l].Cells[0].Value.ToString();
			for (l++; l < ((DataGridView)(object)rmv).Rows.Count && ((DataGridView)(object)rmv).Rows[l].Cells[0].Value.ToString() == rangeValue; l++)
			{
				EndIndex = l;
			}
			Range range3 = (Range)worksheet.Range[(dynamic)worksheet.Cells[StartIndex + 2, 2], (dynamic)worksheet.Cells[EndIndex + 2, 2]];
			range3.Merge(0);
			range3.set_Value(Type.Missing, (object)rangeValue);
			range3.HorizontalAlignment = XlVAlign.xlVAlignCenter;
		}
		for (int k = 0; k < ((DataGridView)(object)rmv).Rows.Count; k++)
		{
			for (int m = 1; m < ((DataGridView)(object)rmv).Columns.Count; m++)
			{
				string cellValue = ((DataGridView)(object)rmv)[m, k].Value.ToString();
				if (cellValue == "-1")
				{
					cellValue = "";
				}
				worksheet.Cells[2 + k, m + 2] = cellValue;
				if (((DataGridView)(object)rmv).Rows[k].HeaderCell.Value != null && ((DataGridView)(object)rmv).Rows[k].HeaderCell.Value.ToString() == "χ")
				{
					Range range = (Range)worksheet.Range[(dynamic)worksheet.Cells[2 + k, m + 2], (dynamic)worksheet.Cells[2 + k, m + 2]];
					range.Font.Bold = true;
					range.Font.Name = "SimSun";
					range.Font.Color = Color.Blue;
				}
				else if (((DataGridView)(object)rmv).Rows[k].HeaderCell.Value != null && (((DataGridView)(object)rmv).Rows[k].HeaderCell.Value.ToString() == "σ" || ((DataGridView)(object)rmv).Rows[k].HeaderCell.Value.ToString() == "%RSD"))
				{
					Range range2 = (Range)worksheet.Range[(dynamic)worksheet.Cells[2 + k, m + 2], (dynamic)worksheet.Cells[2 + k, m + 2]];
					range2.Font.Bold = false;
					range2.Font.Color = Color.Blue;
				}
			}
		}
		worksheet.Columns.EntireColumn.AutoFit();
	}

	private void EditSheet(RowMergeView rmv, Worksheet worksheet, bool IsOriginal = false)
	{
		for (int i = 0; i < ((DataGridView)(object)rmv).Columns.Count; i++)
		{
			worksheet.Cells[1, 2 + i] = ((DataGridView)(object)rmv).Columns[i].HeaderText;
			if (((DataGridView)(object)rmv).Columns[i].DefaultCellStyle.BackColor == Color.Yellow)
			{
				Range range3 = (Range)worksheet.Range[(dynamic)worksheet.Cells[1, 2 + i], (dynamic)worksheet.Cells[((DataGridView)(object)rmv).Rows.Count + 1, 2 + i]];
				range3.Interior.Color = Color.Yellow;
			}
		}
		for (int j = 0; j < ((DataGridView)(object)rmv).Rows.Count; j++)
		{
			worksheet.Cells[2 + j, 1] = ((DataGridView)(object)rmv).Rows[j].HeaderCell.Value;
		}
		int k = 0;
		while (k < ((DataGridView)(object)rmv).Rows.Count)
		{
			int StartIndex = k;
			int EndIndex = k;
			string rangeValue = ((DataGridView)(object)rmv).Rows[k].Cells[0].Value.ToString();
			for (k++; k < ((DataGridView)(object)rmv).Rows.Count && ((DataGridView)(object)rmv).Rows[k].Cells[0].Value.ToString() == rangeValue; k++)
			{
				EndIndex = k;
			}
			Range range5 = (Range)worksheet.Range[(dynamic)worksheet.Cells[StartIndex + 2, 2], (dynamic)worksheet.Cells[EndIndex + 2, 2]];
			range5.Merge(0);
			range5.set_Value(Type.Missing, (object)rangeValue);
			range5.HorizontalAlignment = XlVAlign.xlVAlignCenter;
		}
		for (int l = 0; l < ((DataGridView)(object)rmv).Rows.Count; l++)
		{
			for (int m = 1; m < ((DataGridView)(object)rmv).Columns.Count; m++)
			{
				string cellValue = "";
				double cellValueD = -1.0;
				try
				{
					cellValueD = double.Parse(((DataGridView)(object)rmv)[m, l].Value.ToString());
				}
				catch
				{
				}
				if (((DataGridView)(object)rmv).Rows[l].HeaderCell.Value == null || !(((DataGridView)(object)rmv).Rows[l].HeaderCell.Value.ToString() == "%RSD"))
				{
					cellValue = ((!(((DataGridView)(object)rmv).Columns[m].DefaultCellStyle.BackColor == Color.Yellow) || IsOriginal) ? string.Format(new FormatValue(), "{0:U}", cellValueD) : string.Format(new FormatPercent(), "{0:U}", cellValueD));
				}
				else
				{
					if (CheckRsdColor(cellValueD))
					{
						Range range4 = (Range)worksheet.Range[(dynamic)worksheet.Cells[2 + l, m + 2], (dynamic)worksheet.Cells[2 + l, m + 2]];
						range4.Interior.Color = rsdOutColor;
					}
					cellValue = string.Format(new FormatPercent(), "{0:U}", cellValueD / 100.0);
				}
				worksheet.Cells[2 + l, m + 2] = cellValue;
				if (((DataGridView)(object)rmv).Rows[l].HeaderCell.Value != null && ((DataGridView)(object)rmv).Rows[l].HeaderCell.Value.ToString() == "χ")
				{
					Range range = (Range)worksheet.Range[(dynamic)worksheet.Cells[2 + l, m + 2], (dynamic)worksheet.Cells[2 + l, m + 2]];
					range.Font.Bold = true;
					range.Font.Name = "SimSun";
					range.Font.Color = Color.Blue;
				}
				else if (((DataGridView)(object)rmv).Rows[l].HeaderCell.Value != null && (((DataGridView)(object)rmv).Rows[l].HeaderCell.Value.ToString() == "σ" || ((DataGridView)(object)rmv).Rows[l].HeaderCell.Value.ToString() == "%RSD"))
				{
					Range range2 = (Range)worksheet.Range[(dynamic)worksheet.Cells[2 + l, m + 2], (dynamic)worksheet.Cells[2 + l, m + 2]];
					range2.Font.Bold = false;
					range2.Font.Color = Color.Blue;
				}
			}
		}
		worksheet.Columns.EntireColumn.AutoFit();
	}

	private void ExportResults(string filename, int type)
	{
		using StreamWriter sw = new StreamWriter(filename);
		try
		{
			sw.Write(" ");
			foreach (IsotopeInfos isotope5 in experiment.Isotopes)
			{
				sw.Write(",");
				sw.Write(isotope5.symbol);
			}
			sw.WriteLine();
			foreach (SamplesInfos sample in experiment.Samples)
			{
				if (sample.status != 1 || !sample.report)
				{
					continue;
				}
				sw.WriteLine();
				sw.WriteLine(sample.label);
				for (int i = 0; i < sample.mains; i++)
				{
					sw.Write(i + 1);
					foreach (IsotopeInfos isotope4 in experiment.Isotopes)
					{
						sw.Write(",");
						AnalyseInfos r4 = experiment.Results.Where((AnalyseInfos result) => result.sampleId == sample.guid && result.number == i && result.symbol == isotope4.symbol).First();
						switch (type)
						{
						case 0:
							sw.Write(r4.concentration);
							break;
						case 1:
							sw.Write(r4.intensity);
							break;
						case 2:
							sw.Write(r4.icps);
							break;
						}
					}
					sw.WriteLine();
				}
				sw.Write("average");
				foreach (IsotopeInfos isotope3 in experiment.Isotopes)
				{
					sw.Write(",");
					StatisticResults r3 = experiment.Statistics.Where((StatisticResults result) => result.sampleId == sample.guid && result.symbol == isotope3.symbol).First();
					switch (type)
					{
					case 0:
						sw.Write(r3.avgCon);
						break;
					case 1:
						sw.Write(r3.avgUICPS);
						break;
					case 2:
						sw.Write(r3.avgCPS);
						break;
					}
				}
				sw.WriteLine();
				sw.Write("deviation");
				foreach (IsotopeInfos isotope2 in experiment.Isotopes)
				{
					sw.Write(",");
					StatisticResults r2 = experiment.Statistics.Where((StatisticResults result) => result.sampleId == sample.guid && result.symbol == isotope2.symbol).First();
					switch (type)
					{
					case 0:
						sw.Write(r2.sdCon);
						break;
					case 1:
						sw.Write(r2.sdUICPS);
						break;
					case 2:
						sw.Write(r2.sdCPS);
						break;
					}
				}
				sw.WriteLine();
				sw.Write("%RSD");
				foreach (IsotopeInfos isotope in experiment.Isotopes)
				{
					sw.Write(",");
					StatisticResults r = experiment.Statistics.Where((StatisticResults result) => result.sampleId == sample.guid && result.symbol == isotope.symbol).First();
					switch (type)
					{
					case 0:
						sw.Write(r.rsdCon);
						break;
					case 1:
						sw.Write(r.rsdUICPS);
						break;
					case 2:
						sw.Write(r.rsdCPS);
						break;
					}
				}
				sw.WriteLine();
			}
		}
		catch (Exception ex)
		{
			MessageBox.Show(ex.Message, Lang.Txt("AddFormSpectrums.Warn"), MessageBoxButtons.OK);
		}
	}

	private void dgvRatio_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
	{
		if (e.ColumnIndex <= 0)
		{
			return;
		}
		if (Convert.ToBoolean(((DataGridView)(object)dgvRatio).Columns[e.ColumnIndex].Tag) && ((experiment.ReportParams.ShowRsd && e.RowIndex % 2 == 0) || !experiment.ReportParams.ShowRsd))
		{
			e.Value = string.Format(new FormatPercent(), "{0:U}", e.Value);
		}
		else
		{
			e.Value = string.Format(new FormatValue(), "{0:U}", e.Value);
		}
		if ((experiment.ReportParams.ShowRsd && e.RowIndex % 2 == 0) || !experiment.ReportParams.ShowRsd)
		{
			e.CellStyle.ForeColor = Color.Blue;
			e.CellStyle.Font = new System.Drawing.Font(new FontFamily("SimSun"), 9f, FontStyle.Bold);
			return;
		}
		e.CellStyle.ForeColor = Color.Blue;
		if (CheckRsdColor(e.Value))
		{
			e.CellStyle.BackColor = rsdOutColor;
		}
	}

	private void Results_SetExclude(int rowIndex, int colIndex, bool exclude)
	{
		string symbol = "";
		symbol = ((colIndex != -1) ? dtConcentrationSingle.Columns[colIndex + 1].ColumnName : "");
		int num = Convert.ToInt32(dtConcentrationSingle.Rows[rowIndex]["header"]) - 1;
		int sampleId = (int)((Control)(object)dataGridView1).Tag;
		experiment.SetResultExclude(symbol, sampleId, num, exclude);
		if (exclude)
		{
			if (colIndex != -1)
			{
				Point Exclude4 = new Point(rowIndex, colIndex);
				if (!ptExclude1.Exists((List<int> r) => r[0] == (int)((Control)(object)dataGridView1).Tag && r[1] == Exclude4.X && r[2] == Exclude4.Y))
				{
					ptExclude1.Add(new List<int>
					{
						(int)((Control)(object)dataGridView1).Tag,
						Exclude4.X,
						Exclude4.Y
					});
				}
				return;
			}
			for (int i = 1; i < dtConcentrationSingle.Columns.Count; i++)
			{
				Point Exclude3 = new Point(rowIndex, i);
				if (!ptExclude1.Exists((List<int> r) => r[0] == (int)((Control)(object)dataGridView1).Tag && r[1] == Exclude3.X && r[2] == Exclude3.Y))
				{
					ptExclude1.Add(new List<int>
					{
						(int)((Control)(object)dataGridView1).Tag,
						Exclude3.X,
						Exclude3.Y
					});
				}
			}
			return;
		}
		if (colIndex != -1)
		{
			Point Exclude2 = new Point(rowIndex, colIndex);
			if (ptExclude1.Exists((List<int> r) => r[0] == (int)((Control)(object)dataGridView1).Tag && r[1] == Exclude2.X && r[2] == Exclude2.Y))
			{
				ptExclude1.Remove(ptExclude1.Find((List<int> r) => r[0] == (int)((Control)(object)dataGridView1).Tag && r[1] == Exclude2.X && r[2] == Exclude2.Y));
			}
			return;
		}
		for (int j = 1; j < dtConcentrationSingle.Columns.Count; j++)
		{
			Point Exclude = new Point(rowIndex, j);
			if (ptExclude1.Exists((List<int> r) => r[0] == (int)((Control)(object)dataGridView1).Tag && r[1] == Exclude.X && r[2] == Exclude.Y))
			{
				ptExclude1.Remove(ptExclude1.Find((List<int> r) => r[0] == (int)((Control)(object)dataGridView1).Tag && r[1] == Exclude.X && r[2] == Exclude.Y));
			}
		}
	}

	private void dgvAnalyteICPS_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
	{
	}

	private void dgvAnalyteConcentrations_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
	{
		RowMergeView dgv = (RowMergeView)((sender is RowMergeView) ? sender : null);
		if (e.Button == MouseButtons.Right)
		{
			ContextMenu menu = new ContextMenu();
			menu.MenuItems.Add(Lang.Txt("AddFormNumerics.HideDetailedData"), delegate
			{
				panel1.Parent = null;
				panel1.Visible = false;
				panel2.Dock = DockStyle.Fill;
				panel3.Parent = null;
				panel3.Visible = false;
				panel4.Dock = DockStyle.Fill;
				panel5.Parent = null;
				panel5.Visible = false;
				panel6.Dock = DockStyle.Fill;
			});
			menu.MenuItems.Add(Lang.Txt("AddFormNumerics.ShowDetailedData"), delegate
			{
				panel1.Parent = pageAnalyteConcentration;
				panel1.Visible = true;
				panel1.Dock = DockStyle.Bottom;
				panel2.Dock = DockStyle.Fill;
				panel3.Parent = pageUncorrectICPS;
				panel3.Visible = true;
				panel3.Dock = DockStyle.Bottom;
				panel4.Dock = DockStyle.Fill;
				panel5.Parent = pageAnalyteICPS;
				panel5.Dock = DockStyle.Bottom;
				panel5.Visible = true;
				panel6.Dock = DockStyle.Fill;
			});
			Rectangle rect = ((DataGridView)(object)dgv).GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, cutOverflow: false);
			Point pt = e.Location;
			pt.Offset(rect.X, rect.Y);
			menu.Show((Control)(object)dgv, pt);
		}
	}

	private void tsbtnDatas_Click(object sender, EventArgs e)
	{
		if (isInRefresh)
		{
			MessageBox.Show(Lang.Txt("FormNumerics.RefreshInfo.Text"), Lang.Txt("AddFormSpectrums.Warn"), MessageBoxButtons.OK);
			return;
		}
		isInRefresh = true;
		using FormShowdata dlg = new FormShowdata(experiment);
		dlg.ShowDialog();
		isInRefresh = false;
		RefreshResults();
	}

	private void FormNumerics_FormClosing(object sender, FormClosingEventArgs e)
	{
	}

	private void dgvAnalyteICPS_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
	{
		try
		{
			int sampleindex = -1;
			if (experiment.ReportParams.ShowRsd)
			{
				sampleindex = e.RowIndex / 2;
			}
			else
			{
				sampleindex = e.RowIndex;
			}
			List<SamplesInfos> samples = experiment.Samples.FindAll((SamplesInfos r) => r.report && r.status != 0);
			string symbol = ((DataGridView)(object)dgvAnalyteICPS).Columns[e.ColumnIndex].Name;
			StatisticResults stat = experiment.Statistics.Find((StatisticResults r) => r.sampleId == samples[sampleindex].guid && r.symbol == symbol);
			if (e.ColumnIndex == 0)
			{
				e.Value = samples[sampleindex].label + "\n" + samples[sampleindex].time.ToString("dd/MM HH:mm");
				return;
			}
			if (experiment.ReportParams.ShowRsd)
			{
				if (e.RowIndex % 2 == 0)
				{
					e.Value = stat.avgCPS;
				}
				else
				{
					e.Value = stat.rsdCPS;
				}
			}
			else
			{
				e.Value = stat.avgCPS;
			}
			if (e.Value != null)
			{
			}
		}
		catch (Exception)
		{
			e.Value = -1;
		}
	}

	private void dgvUncorrectedICPS_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
	{
		int sampleindex = -1;
		if (experiment.ReportParams.ShowRsd)
		{
			sampleindex = e.RowIndex / 2;
		}
		else
		{
			sampleindex = e.RowIndex;
		}
		List<SamplesInfos> samples = experiment.Samples.FindAll((SamplesInfos r) => r.report && r.status != 0);
		string symbol = ((DataGridView)(object)dgvUncorrectedICPS).Columns[e.ColumnIndex].Name;
		if (sampleindex > samples.Count())
		{
			sampleindex = sampleindex / 2 + sampleindex % 2;
		}
		StatisticResults stat = experiment.Statistics.Find((StatisticResults r) => r.sampleId == samples[sampleindex].guid && r.symbol == symbol);
		if (e.ColumnIndex == 0)
		{
			e.Value = samples[sampleindex].label + "\n" + samples[sampleindex].time.ToString("dd/MM HH:mm");
		}
		else if (experiment.ReportParams.ShowRsd)
		{
			if (e.RowIndex % 2 == 0)
			{
				e.Value = stat.avgUICPS;
			}
			else
			{
				e.Value = stat.rsdUICPS;
			}
		}
		else
		{
			e.Value = stat.avgUICPS;
		}
	}

	private void dgvAnalyteConcentrations_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
	{
		try
		{
			int sampleindex = -1;
			if (experiment.ReportParams.ShowRsd)
			{
				sampleindex = e.RowIndex / 2;
			}
			else
			{
				sampleindex = e.RowIndex;
			}
			List<SamplesInfos> samples = experiment.Samples.FindAll((SamplesInfos r) => r.report && r.status != 0);
			string symbol = ((DataGridView)(object)dgvAnalyteConcentrations).Columns[e.ColumnIndex].Name;
			if (sampleindex > samples.Count())
			{
				sampleindex = sampleindex / 2 + sampleindex % 2;
			}
			StatisticResults stat = experiment.Statistics.Find((StatisticResults r) => r.sampleId == samples[sampleindex].guid && r.symbol == symbol);
			if (e.ColumnIndex == 0)
			{
				e.Value = samples[sampleindex].label + "\n" + samples[sampleindex].time.ToString("dd/MM HH:mm");
			}
			else if (experiment.ReportParams.ShowRsd)
			{
				if (e.RowIndex % 2 == 0)
				{
					e.Value = stat.avgCon;
				}
				else
				{
					e.Value = stat.rsdCon;
				}
			}
			else
			{
				e.Value = stat.avgCon;
			}
		}
		catch (Exception ex)
		{
			e.Value = "";
			Log.InsertLog(Lang.Txt("AddFormNumerics.RefreshData"), Lang.Txt("AddFormNumerics.RefreshDataWrong"), ex.Message, (Severity)2);
		}
	}

	private void toolStripComboBoxPA_SelectedIndexChanged(object sender, EventArgs e)
	{
		tsbtnRefresh_Click(null, null);
	}

	private void tsbtnSaveResult_ButtonClick(object sender, EventArgs e)
	{
	}

	private void ExportRun(object sender, ExpDataArgs e)
	{
		ProgressBar bar = sender as ProgressBar;
		if (bar != null)
		{
			Invoke((MethodInvoker)delegate
			{
				bar.Style = ProgressBarStyle.Marquee;
			});
		}
		if (formExport != null)
		{
			ExportExcel(formExport.FilePath, formExport.ShowConc, formExport.ShowUcps, formExport.ShowIcps, formExport.ShowRatio);
		}
	}

	private void toolStripButtonExport_Click(object sender, EventArgs e)
	{
		if (formExport == null)
		{
			formExport = new FormExport(base.ParentForm.ParentForm.Text);
		}
		if (formExport.ShowDialog() == DialogResult.OK)
		{
			FormWait wait = new FormWait();
			wait.StartPosition = FormStartPosition.CenterParent;
			wait.Text = Lang.Txt("AddFormNumerics.Export");
			wait.Run += ExportRun;
			wait.Show();
		}
	}

	private void dgvAnalyteConcentrations_SelectionChanged(object sender, EventArgs e)
	{
		RowMergeView dgv = (RowMergeView)((sender is RowMergeView) ? sender : null);
		if (((DataGridView)(object)dgv).SelectedRows == null || ((DataGridView)(object)dgv).SelectedRows.Count <= 0)
		{
			return;
		}
		int rowindex = ((DataGridView)(object)dgv).SelectedRows[0].Index;
		int indexcount = 0;
		int sampleid = -1;
		foreach (SamplesInfos sample in experiment.Samples)
		{
			if (sample.report && sample.status != 0)
			{
				indexcount++;
				if (indexcount == rowindex + 1)
				{
					sampleid = sample.guid;
					break;
				}
				if (experiment.ReportParams.ShowRsd)
				{
					indexcount++;
				}
				if (indexcount == rowindex + 1)
				{
					sampleid = sample.guid;
					break;
				}
			}
		}
		((DataGridView)(object)dgvAnalyteConcentrations).CurrentCell = ((DataGridView)(object)dgvAnalyteConcentrations).Rows[rowindex].Cells[0];
		((DataGridView)(object)dgvUncorrectedICPS).CurrentCell = ((DataGridView)(object)dgvUncorrectedICPS).Rows[rowindex].Cells[0];
		((DataGridView)(object)dgvAnalyteICPS).CurrentCell = ((DataGridView)(object)dgvAnalyteICPS).Rows[rowindex].Cells[0];
		InitConcentrationForSingle(experiment.Samples.Find((SamplesInfos r) => r.guid == sampleid));
		InitAnalyteICPSForSingle(experiment.Samples.Find((SamplesInfos r) => r.guid == sampleid));
		InitUncorrectCPSForSingle(experiment.Samples.Find((SamplesInfos r) => r.guid == sampleid));
	}

	private void dataGridView1_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
	{
		if (e.ColumnIndex > 0)
		{
			e.Value = dtConcentrationSingle.Rows[e.RowIndex][e.ColumnIndex + 1];
		}
		else
		{
			e.Value = dtConcentrationSingle.Rows[e.RowIndex][e.ColumnIndex];
		}
	}

	private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
	{
		if (e.ColumnIndex <= 0)
		{
			return;
		}
		if (dtConcentrationSingle.Columns[e.ColumnIndex + 1].ExtendedProperties.ContainsKey(true) && dtConcentrationSingle.Rows[e.RowIndex]["header"].ToString() != "%RSD")
		{
			e.Value = string.Format(new FormatPercent(), "{0:U}", e.Value);
		}
		else
		{
			e.Value = string.Format(new FormatValue(), "{0:U}", e.Value);
		}
		if (dtConcentrationSingle.Rows[e.RowIndex]["header"].ToString() == "χ")
		{
			e.CellStyle.ForeColor = Color.Blue;
			e.CellStyle.Font = new System.Drawing.Font(new FontFamily("SimSun"), 9f, FontStyle.Bold);
		}
		else if (dtConcentrationSingle.Rows[e.RowIndex]["header"].ToString() == "σ")
		{
			e.CellStyle.ForeColor = Color.Blue;
		}
		else if (dtConcentrationSingle.Rows[e.RowIndex]["header"].ToString() == "%RSD")
		{
			e.CellStyle.ForeColor = Color.Blue;
			if (CheckRsdColor(e.Value))
			{
				e.CellStyle.BackColor = rsdOutColor;
			}
		}
		else if (ptExclude1.Exists((List<int> r) => r[0] == (int)((Control)(object)dataGridView1).Tag && r[1] == e.RowIndex && r[2] == e.ColumnIndex))
		{
			e.CellStyle.ForeColor = Color.Red;
		}
		else
		{
			e.CellStyle.ForeColor = Color.Black;
		}
	}

	private void dgvAnalyteConcentrations_Scroll(object sender, ScrollEventArgs e)
	{
		try
		{
			RowMergeView dgv = (RowMergeView)((sender is RowMergeView) ? sender : null);
			((DataGridView)(object)dataGridView1).FirstDisplayedScrollingColumnIndex = ((DataGridView)(object)dgv).FirstDisplayedScrollingColumnIndex;
			((DataGridView)(object)rowMergeView1).FirstDisplayedScrollingColumnIndex = ((DataGridView)(object)dgv).FirstDisplayedScrollingColumnIndex;
			((DataGridView)(object)rowMergeView2).FirstDisplayedScrollingColumnIndex = ((DataGridView)(object)dgv).FirstDisplayedScrollingColumnIndex;
			((DataGridView)(object)dgvUncorrectedICPS).FirstDisplayedScrollingColumnIndex = ((DataGridView)(object)dgv).FirstDisplayedScrollingColumnIndex;
			((DataGridView)(object)dgvAnalyteICPS).FirstDisplayedScrollingColumnIndex = ((DataGridView)(object)dgv).FirstDisplayedScrollingColumnIndex;
			((DataGridView)(object)dgvAnalyteConcentrations).FirstDisplayedScrollingColumnIndex = ((DataGridView)(object)dgv).FirstDisplayedScrollingColumnIndex;
			((DataGridView)(object)dgvUncorrectedICPS).FirstDisplayedScrollingRowIndex = ((DataGridView)(object)dgv).FirstDisplayedScrollingRowIndex;
			((DataGridView)(object)dgvAnalyteICPS).FirstDisplayedScrollingRowIndex = ((DataGridView)(object)dgv).FirstDisplayedScrollingRowIndex;
			((DataGridView)(object)dgvAnalyteConcentrations).FirstDisplayedScrollingRowIndex = ((DataGridView)(object)dgv).FirstDisplayedScrollingRowIndex;
		}
		catch (Exception)
		{
		}
	}

	private void dataGridView1_Scroll(object sender, ScrollEventArgs e)
	{
		try
		{
			RowMergeView dgv = (RowMergeView)((sender is RowMergeView) ? sender : null);
			((DataGridView)(object)dataGridView1).FirstDisplayedScrollingColumnIndex = ((DataGridView)(object)dgv).FirstDisplayedScrollingColumnIndex;
			((DataGridView)(object)rowMergeView1).FirstDisplayedScrollingColumnIndex = ((DataGridView)(object)dgv).FirstDisplayedScrollingColumnIndex;
			((DataGridView)(object)rowMergeView2).FirstDisplayedScrollingColumnIndex = ((DataGridView)(object)dgv).FirstDisplayedScrollingColumnIndex;
			((DataGridView)(object)dgvUncorrectedICPS).FirstDisplayedScrollingColumnIndex = ((DataGridView)(object)dgv).FirstDisplayedScrollingColumnIndex;
			((DataGridView)(object)dgvAnalyteICPS).FirstDisplayedScrollingColumnIndex = ((DataGridView)(object)dgv).FirstDisplayedScrollingColumnIndex;
			((DataGridView)(object)dgvAnalyteConcentrations).FirstDisplayedScrollingColumnIndex = ((DataGridView)(object)dgv).FirstDisplayedScrollingColumnIndex;
			((DataGridView)(object)dataGridView1).FirstDisplayedScrollingRowIndex = ((DataGridView)(object)dgv).FirstDisplayedScrollingRowIndex;
			((DataGridView)(object)rowMergeView1).FirstDisplayedScrollingRowIndex = ((DataGridView)(object)dgv).FirstDisplayedScrollingRowIndex;
			((DataGridView)(object)rowMergeView2).FirstDisplayedScrollingRowIndex = ((DataGridView)(object)dgv).FirstDisplayedScrollingRowIndex;
		}
		catch (Exception)
		{
		}
	}

	private void dataGridView1_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Expected O, but got Unknown
		RowMergeView dgv = (RowMergeView)sender;
		if (e.Button == MouseButtons.Right && e.ColumnIndex > 0 && dtConcentrationSingle.Rows[e.RowIndex]["header"].ToString() != "χ" && dtConcentrationSingle.Rows[e.RowIndex]["header"].ToString() != "σ" && dtConcentrationSingle.Rows[e.RowIndex]["header"].ToString() != "%RSD")
		{
			ContextMenu menu = new ContextMenu();
			menu.MenuItems.Add(Lang.Txt("FormNumerics.Include.Text"), delegate
			{
				Results_SetExclude(e.RowIndex, e.ColumnIndex, exclude: false);
				((DataGridView)(object)dgv).InvalidateCell(((DataGridView)(object)dgv).Rows[e.RowIndex].Cells[e.ColumnIndex]);
			});
			menu.MenuItems.Add(Lang.Txt("FormNumerics.Exclude.Text"), delegate
			{
				Results_SetExclude(e.RowIndex, e.ColumnIndex, exclude: true);
				((DataGridView)(object)dgv).InvalidateCell(((DataGridView)(object)dgv).Rows[e.RowIndex].Cells[e.ColumnIndex]);
			});
			menu.MenuItems.Add(Lang.Txt("AddFormNumerics.IncludeLine"), delegate
			{
				Results_SetExclude(e.RowIndex, -1, exclude: false);
				((DataGridView)(object)dgv).InvalidateRow(e.RowIndex);
			});
			menu.MenuItems.Add(Lang.Txt("AddFormNumerics.DeleteLine"), delegate
			{
				Results_SetExclude(e.RowIndex, -1, exclude: true);
				((DataGridView)(object)dgv).InvalidateRow(e.RowIndex);
			});
			Rectangle rect = ((DataGridView)(object)dgv).GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, cutOverflow: false);
			Point pt = e.Location;
			pt.Offset(rect.X, rect.Y);
			menu.Show((Control)(object)dgv, pt);
		}
	}

	private void rowMergeView1_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
	{
		if (e.ColumnIndex > 0)
		{
			e.Value = dtUncorrectCPSSingle.Rows[e.RowIndex][e.ColumnIndex + 1];
		}
		else
		{
			e.Value = dtUncorrectCPSSingle.Rows[e.RowIndex][e.ColumnIndex];
		}
	}

	private void rowMergeView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
	{
		if (e.ColumnIndex <= 0)
		{
			return;
		}
		if (e.Value.Equals(-1))
		{
			e.Value = null;
		}
		else
		{
			e.Value = string.Format(new FormatValue(), "{0:U}", e.Value);
		}
		if (dtUncorrectCPSSingle.Rows[e.RowIndex]["header"].ToString() == "χ")
		{
			e.CellStyle.ForeColor = Color.Blue;
			e.CellStyle.Font = new System.Drawing.Font(new FontFamily("SimSun"), 9f, FontStyle.Bold);
		}
		else if (dtUncorrectCPSSingle.Rows[e.RowIndex]["header"].ToString() == "σ")
		{
			e.CellStyle.ForeColor = Color.Blue;
		}
		else if (dtUncorrectCPSSingle.Rows[e.RowIndex]["header"].ToString() == "%RSD")
		{
			e.CellStyle.ForeColor = Color.Blue;
			if (CheckRsdColor(e.Value))
			{
				e.CellStyle.BackColor = rsdOutColor;
			}
		}
		else if (ptExclude1.Exists((List<int> r) => r[0] == (int)((Control)(object)rowMergeView1).Tag && r[1] == e.RowIndex && r[2] == e.ColumnIndex))
		{
			e.CellStyle.ForeColor = Color.Red;
		}
		else
		{
			e.CellStyle.ForeColor = Color.Black;
		}
	}

	private void rowMergeView2_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
	{
		if (e.ColumnIndex > 0)
		{
			e.Value = dtAnalyteICPSSingle.Rows[e.RowIndex][e.ColumnIndex + 1];
		}
		else
		{
			e.Value = dtAnalyteICPSSingle.Rows[e.RowIndex][e.ColumnIndex];
		}
	}

	private void rowMergeView2_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
	{
		if (e.ColumnIndex <= 0)
		{
			return;
		}
		if (dtAnalyteICPSSingle.Columns[e.ColumnIndex + 1].ExtendedProperties.ContainsKey(true) && dtAnalyteICPSSingle.Rows[e.RowIndex]["header"].ToString() != "%RSD")
		{
			e.Value = string.Format(new FormatPercent(), "{0:U}", e.Value);
		}
		else
		{
			e.Value = string.Format(new FormatValue(), "{0:U}", e.Value);
		}
		if (dtAnalyteICPSSingle.Rows[e.RowIndex]["header"].ToString() == "χ")
		{
			e.CellStyle.ForeColor = Color.Blue;
			e.CellStyle.Font = new System.Drawing.Font(new FontFamily("SimSun"), 9f, FontStyle.Bold);
		}
		else if (dtAnalyteICPSSingle.Rows[e.RowIndex]["header"].ToString() == "σ")
		{
			e.CellStyle.ForeColor = Color.Blue;
		}
		else if (dtAnalyteICPSSingle.Rows[e.RowIndex]["header"].ToString() == "%RSD")
		{
			e.CellStyle.ForeColor = Color.Blue;
			if (CheckRsdColor(e.Value))
			{
				e.CellStyle.BackColor = rsdOutColor;
			}
		}
		else if (ptExclude1.Exists((List<int> r) => r[0] == (int)((Control)(object)rowMergeView2).Tag && r[1] == e.RowIndex && r[2] == e.ColumnIndex))
		{
			e.CellStyle.ForeColor = Color.Red;
		}
		else
		{
			e.CellStyle.ForeColor = Color.Black;
		}
	}

	private void dgvRatio_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
	{
		RowMergeView dgv = (RowMergeView)((sender is RowMergeView) ? sender : null);
		if (e.Button == MouseButtons.Right)
		{
			ContextMenu menu = new ContextMenu();
			menu.MenuItems.Add(Lang.Txt("AddFormNumerics.HideDetailedData"), delegate
			{
				panel7.Parent = null;
				panel8.Dock = DockStyle.Fill;
			});
			menu.MenuItems.Add(Lang.Txt("AddFormNumerics.ShowDetailedData"), delegate
			{
				panel7.Parent = pageRatio;
				panel7.Dock = DockStyle.Bottom;
				panel8.Dock = DockStyle.Fill;
			});
			Rectangle rect = ((DataGridView)(object)dgv).GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, cutOverflow: false);
			Point pt = e.Location;
			pt.Offset(rect.X, rect.Y);
			menu.Show((Control)(object)dgv, pt);
		}
	}

	private void dgvRatio_SelectionChanged(object sender, EventArgs e)
	{
		if (((DataGridView)(object)dgvRatio).SelectedRows == null || ((DataGridView)(object)dgvRatio).SelectedRows.Count <= 0)
		{
			return;
		}
		int rowindex = ((DataGridView)(object)dgvRatio).SelectedRows[0].Index;
		int indexcount = 0;
		int sampleid = -1;
		foreach (SamplesInfos sample in experiment.Samples)
		{
			if (sample.report && sample.status != 0)
			{
				indexcount++;
				if (indexcount == rowindex + 1)
				{
					sampleid = sample.guid;
					break;
				}
				if (experiment.ReportParams.ShowRsd)
				{
					indexcount++;
				}
				if (indexcount == rowindex + 1)
				{
					sampleid = sample.guid;
					break;
				}
			}
		}
		InitRatiosForSingle(experiment.Samples.Find((SamplesInfos r) => r.guid == sampleid));
	}

	private void dgvRatio_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
	{
		try
		{
			int sampleindex = -1;
			if (experiment.ReportParams.ShowRsd)
			{
				sampleindex = e.RowIndex / 2;
			}
			else
			{
				sampleindex = e.RowIndex;
			}
			List<SamplesInfos> samples = experiment.Samples.FindAll((SamplesInfos r) => r.report && r.status != 0);
			string symbol = ((DataGridView)(object)dgvRatio).Columns[e.ColumnIndex].Name;
			if (sampleindex > samples.Count())
			{
				sampleindex = sampleindex / 2 + sampleindex % 2;
			}
			RatioStatistics stat = experiment.RatioStat.Find((RatioStatistics r) => r.SampleId == samples[sampleindex].guid && r.Name == symbol);
			if (e.ColumnIndex == 0)
			{
				e.Value = samples[sampleindex].label + "\n" + samples[sampleindex].time.ToString("dd/MM HH:mm");
			}
			else if (experiment.ReportParams.ShowRsd)
			{
				if (e.RowIndex % 2 == 0)
				{
					e.Value = stat.CaliAvg;
				}
				else
				{
					e.Value = stat.Rsd;
				}
			}
			else
			{
				e.Value = stat.CaliAvg;
			}
		}
		catch (Exception)
		{
		}
	}

	private void rowMergeView3_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
	{
		if (e.ColumnIndex > 0)
		{
			e.Value = dtRatioSingle.Rows[e.RowIndex][e.ColumnIndex + 1];
		}
		else
		{
			e.Value = dtRatioSingle.Rows[e.RowIndex][e.ColumnIndex];
		}
	}

	private void rowMergeView3_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
	{
		if (e.ColumnIndex <= 0)
		{
			return;
		}
		if (dtRatioSingle.Columns[e.ColumnIndex + 1].ExtendedProperties.ContainsKey(true) && dtRatioSingle.Rows[e.RowIndex]["header"].ToString() != "%RSD")
		{
			e.Value = string.Format(new FormatPercent(), "{0:U}", e.Value);
		}
		else
		{
			e.Value = string.Format(new FormatValue(), "{0:U}", e.Value);
		}
		if (dtRatioSingle.Rows[e.RowIndex]["header"].ToString() == "χ")
		{
			e.CellStyle.ForeColor = Color.Blue;
			e.CellStyle.Font = new System.Drawing.Font(new FontFamily("SimSun"), 9f, FontStyle.Bold);
		}
		else if (dtRatioSingle.Rows[e.RowIndex]["header"].ToString() == "σ")
		{
			e.CellStyle.ForeColor = Color.Blue;
		}
		else if (dtRatioSingle.Rows[e.RowIndex]["header"].ToString() == "%RSD")
		{
			e.CellStyle.ForeColor = Color.Blue;
			if (CheckRsdColor(e.Value))
			{
				e.CellStyle.BackColor = rsdOutColor;
			}
		}
	}

	private void dgvAnalyteConcentrations_DataError(object sender, DataGridViewDataErrorEventArgs e)
	{
		RowMergeView dgv = (RowMergeView)((sender is RowMergeView) ? sender : null);
		((DataGridView)(object)dgv).Rows[e.RowIndex].Cells[e.ColumnIndex].Value = double.NaN;
	}

	protected override void Dispose(bool disposing)
	{
		if (disposing && components != null)
		{
			components.Dispose();
		}
		base.Dispose(disposing);
	}

	private void InitializeComponent()
	{
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Expected O, but got Unknown
		//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d5: Expected O, but got Unknown
		//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f6: Expected O, but got Unknown
		//IL_0102: Unknown result type (might be due to invalid IL or missing references)
		//IL_010c: Expected O, but got Unknown
		//IL_0123: Unknown result type (might be due to invalid IL or missing references)
		//IL_012d: Expected O, but got Unknown
		//IL_0139: Unknown result type (might be due to invalid IL or missing references)
		//IL_0143: Expected O, but got Unknown
		//IL_015a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0164: Expected O, but got Unknown
		//IL_0170: Unknown result type (might be due to invalid IL or missing references)
		//IL_017a: Expected O, but got Unknown
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
		System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ICP_MS.Plugin.Experiment.FormNumerics));
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
		this.tabNumeric = new System.Windows.Forms.TabControl();
		this.pageAnalyteConcentration = new System.Windows.Forms.TabPage();
		this.panel2 = new System.Windows.Forms.Panel();
		this.dgvAnalyteConcentrations = new RowMergeView();
		this.panel1 = new System.Windows.Forms.Panel();
		this.dataGridView1 = new RowMergeView();
		this.pageUncorrectICPS = new System.Windows.Forms.TabPage();
		this.panel4 = new System.Windows.Forms.Panel();
		this.dgvUncorrectedICPS = new RowMergeView();
		this.panel3 = new System.Windows.Forms.Panel();
		this.rowMergeView1 = new RowMergeView();
		this.pageAnalyteICPS = new System.Windows.Forms.TabPage();
		this.panel6 = new System.Windows.Forms.Panel();
		this.dgvAnalyteICPS = new RowMergeView();
		this.panel5 = new System.Windows.Forms.Panel();
		this.rowMergeView2 = new RowMergeView();
		this.pageRatio = new System.Windows.Forms.TabPage();
		this.panel8 = new System.Windows.Forms.Panel();
		this.dgvRatio = new RowMergeView();
		this.panel7 = new System.Windows.Forms.Panel();
		this.rowMergeView3 = new RowMergeView();
		this.toolStrip1 = new System.Windows.Forms.ToolStrip();
		this.tsbtnRefresh = new System.Windows.Forms.ToolStripButton();
		this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
		this.toolStripButtonExport = new System.Windows.Forms.ToolStripButton();
		this.tsbtnSaveResult = new System.Windows.Forms.ToolStripSplitButton();
		this.tsmiCONC = new System.Windows.Forms.ToolStripMenuItem();
		this.tsmiUCPS = new System.Windows.Forms.ToolStripMenuItem();
		this.tsmiCPS = new System.Windows.Forms.ToolStripMenuItem();
		this.tsbtnDatas = new System.Windows.Forms.ToolStripButton();
		this.toolStripComboBoxPA = new System.Windows.Forms.ToolStripComboBox();
		this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.tabNumeric.SuspendLayout();
		this.pageAnalyteConcentration.SuspendLayout();
		this.panel2.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.dgvAnalyteConcentrations).BeginInit();
		this.panel1.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.dataGridView1).BeginInit();
		this.pageUncorrectICPS.SuspendLayout();
		this.panel4.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.dgvUncorrectedICPS).BeginInit();
		this.panel3.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.rowMergeView1).BeginInit();
		this.pageAnalyteICPS.SuspendLayout();
		this.panel6.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.dgvAnalyteICPS).BeginInit();
		this.panel5.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.rowMergeView2).BeginInit();
		this.pageRatio.SuspendLayout();
		this.panel8.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.dgvRatio).BeginInit();
		this.panel7.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.rowMergeView3).BeginInit();
		this.toolStrip1.SuspendLayout();
		base.SuspendLayout();
		this.tabNumeric.Alignment = System.Windows.Forms.TabAlignment.Bottom;
		this.tabNumeric.Controls.Add(this.pageAnalyteConcentration);
		this.tabNumeric.Controls.Add(this.pageUncorrectICPS);
		this.tabNumeric.Controls.Add(this.pageAnalyteICPS);
		this.tabNumeric.Controls.Add(this.pageRatio);
		this.tabNumeric.Dock = System.Windows.Forms.DockStyle.Fill;
		this.tabNumeric.Location = new System.Drawing.Point(0, 28);
		this.tabNumeric.Margin = new System.Windows.Forms.Padding(4);
		this.tabNumeric.Multiline = true;
		this.tabNumeric.Name = "tabNumeric";
		this.tabNumeric.RightToLeft = System.Windows.Forms.RightToLeft.No;
		this.tabNumeric.SelectedIndex = 0;
		this.tabNumeric.Size = new System.Drawing.Size(1096, 613);
		this.tabNumeric.TabIndex = 0;
		this.pageAnalyteConcentration.Controls.Add(this.panel2);
		this.pageAnalyteConcentration.Controls.Add(this.panel1);
		this.pageAnalyteConcentration.Location = new System.Drawing.Point(4, 4);
		this.pageAnalyteConcentration.Margin = new System.Windows.Forms.Padding(4);
		this.pageAnalyteConcentration.Name = "pageAnalyteConcentration";
		this.pageAnalyteConcentration.Padding = new System.Windows.Forms.Padding(4);
		this.pageAnalyteConcentration.Size = new System.Drawing.Size(1088, 584);
		this.pageAnalyteConcentration.TabIndex = 0;
		this.pageAnalyteConcentration.Text = "计算浓度";
		this.pageAnalyteConcentration.UseVisualStyleBackColor = true;
		this.panel2.Controls.Add((System.Windows.Forms.Control)(object)this.dgvAnalyteConcentrations);
		this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
		this.panel2.Location = new System.Drawing.Point(4, 4);
		this.panel2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
		this.panel2.Name = "panel2";
		this.panel2.Size = new System.Drawing.Size(1080, 312);
		this.panel2.TabIndex = 3;
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteConcentrations).AllowUserToAddRows = false;
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteConcentrations).AllowUserToDeleteRows = false;
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteConcentrations).AllowUserToResizeRows = false;
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteConcentrations).BackgroundColor = System.Drawing.SystemColors.Window;
		dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteConcentrations).ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteConcentrations).ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
		dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle12.BackColor = System.Drawing.SystemColors.Window;
		dataGridViewCellStyle12.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle12.ForeColor = System.Drawing.SystemColors.ControlText;
		dataGridViewCellStyle12.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle12.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteConcentrations).DefaultCellStyle = dataGridViewCellStyle12;
		((System.Windows.Forms.Control)(object)this.dgvAnalyteConcentrations).Dock = System.Windows.Forms.DockStyle.Fill;
		((System.Windows.Forms.Control)(object)this.dgvAnalyteConcentrations).Location = new System.Drawing.Point(0, 0);
		((System.Windows.Forms.Control)(object)this.dgvAnalyteConcentrations).Margin = new System.Windows.Forms.Padding(4);
		this.dgvAnalyteConcentrations.MergeColumnHeaderBackColor = System.Drawing.SystemColors.Control;
		this.dgvAnalyteConcentrations.MergeColumnNames = (System.Collections.Generic.List<string>)resources.GetObject("dgvAnalyteConcentrations.MergeColumnNames");
		((System.Windows.Forms.Control)(object)this.dgvAnalyteConcentrations).Name = "dgvAnalyteConcentrations";
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteConcentrations).ReadOnly = true;
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteConcentrations).RowHeadersWidth = 60;
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteConcentrations).RowTemplate.Height = 23;
		((System.Windows.Forms.Control)(object)this.dgvAnalyteConcentrations).Size = new System.Drawing.Size(1080, 312);
		((System.Windows.Forms.Control)(object)this.dgvAnalyteConcentrations).TabIndex = 0;
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteConcentrations).VirtualMode = true;
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteConcentrations).CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(dgvAnalyteConcentrations_CellFormatting);
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteConcentrations).CellMouseDown += new System.Windows.Forms.DataGridViewCellMouseEventHandler(dgvAnalyteConcentrations_CellMouseDown);
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteConcentrations).CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(dgvAnalyteConcentrations_CellValueNeeded);
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteConcentrations).DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(dgvAnalyteConcentrations_DataError);
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteConcentrations).RowPrePaint += new System.Windows.Forms.DataGridViewRowPrePaintEventHandler(dgvAnalyteConcentrations_RowPrePaint);
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteConcentrations).Scroll += new System.Windows.Forms.ScrollEventHandler(dgvAnalyteConcentrations_Scroll);
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteConcentrations).SelectionChanged += new System.EventHandler(dgvAnalyteConcentrations_SelectionChanged);
		this.panel1.Controls.Add((System.Windows.Forms.Control)(object)this.dataGridView1);
		this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
		this.panel1.Location = new System.Drawing.Point(4, 316);
		this.panel1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
		this.panel1.Name = "panel1";
		this.panel1.Size = new System.Drawing.Size(1080, 264);
		this.panel1.TabIndex = 2;
		((System.Windows.Forms.DataGridView)(object)this.dataGridView1).AllowUserToAddRows = false;
		((System.Windows.Forms.DataGridView)(object)this.dataGridView1).AllowUserToDeleteRows = false;
		((System.Windows.Forms.DataGridView)(object)this.dataGridView1).ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
		dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle13.BackColor = System.Drawing.SystemColors.Window;
		dataGridViewCellStyle13.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle13.ForeColor = System.Drawing.SystemColors.ControlText;
		dataGridViewCellStyle13.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle13.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle13.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
		((System.Windows.Forms.DataGridView)(object)this.dataGridView1).DefaultCellStyle = dataGridViewCellStyle13;
		((System.Windows.Forms.Control)(object)this.dataGridView1).Dock = System.Windows.Forms.DockStyle.Fill;
		((System.Windows.Forms.Control)(object)this.dataGridView1).Location = new System.Drawing.Point(0, 0);
		((System.Windows.Forms.Control)(object)this.dataGridView1).Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
		this.dataGridView1.MergeColumnHeaderBackColor = System.Drawing.SystemColors.Control;
		this.dataGridView1.MergeColumnNames = (System.Collections.Generic.List<string>)resources.GetObject("dataGridView1.MergeColumnNames");
		((System.Windows.Forms.Control)(object)this.dataGridView1).Name = "dataGridView1";
		dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle14.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle14.Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle14.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle14.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle14.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		((System.Windows.Forms.DataGridView)(object)this.dataGridView1).RowHeadersDefaultCellStyle = dataGridViewCellStyle14;
		((System.Windows.Forms.DataGridView)(object)this.dataGridView1).RowHeadersWidth = 51;
		((System.Windows.Forms.DataGridView)(object)this.dataGridView1).RowTemplate.Height = 27;
		((System.Windows.Forms.Control)(object)this.dataGridView1).Size = new System.Drawing.Size(1080, 264);
		((System.Windows.Forms.Control)(object)this.dataGridView1).TabIndex = 1;
		((System.Windows.Forms.DataGridView)(object)this.dataGridView1).VirtualMode = true;
		((System.Windows.Forms.DataGridView)(object)this.dataGridView1).CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(dataGridView1_CellFormatting);
		((System.Windows.Forms.DataGridView)(object)this.dataGridView1).CellMouseDown += new System.Windows.Forms.DataGridViewCellMouseEventHandler(dataGridView1_CellMouseDown);
		((System.Windows.Forms.DataGridView)(object)this.dataGridView1).CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(dataGridView1_CellValueNeeded);
		((System.Windows.Forms.DataGridView)(object)this.dataGridView1).DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(dgvAnalyteConcentrations_DataError);
		((System.Windows.Forms.DataGridView)(object)this.dataGridView1).Scroll += new System.Windows.Forms.ScrollEventHandler(dataGridView1_Scroll);
		this.pageUncorrectICPS.Controls.Add(this.panel4);
		this.pageUncorrectICPS.Controls.Add(this.panel3);
		this.pageUncorrectICPS.Location = new System.Drawing.Point(4, 4);
		this.pageUncorrectICPS.Margin = new System.Windows.Forms.Padding(4);
		this.pageUncorrectICPS.Name = "pageUncorrectICPS";
		this.pageUncorrectICPS.Padding = new System.Windows.Forms.Padding(4);
		this.pageUncorrectICPS.Size = new System.Drawing.Size(1088, 584);
		this.pageUncorrectICPS.TabIndex = 1;
		this.pageUncorrectICPS.Text = "原始强度";
		this.pageUncorrectICPS.UseVisualStyleBackColor = true;
		this.panel4.Controls.Add((System.Windows.Forms.Control)(object)this.dgvUncorrectedICPS);
		this.panel4.Dock = System.Windows.Forms.DockStyle.Fill;
		this.panel4.Location = new System.Drawing.Point(4, 4);
		this.panel4.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
		this.panel4.Name = "panel4";
		this.panel4.Size = new System.Drawing.Size(1080, 312);
		this.panel4.TabIndex = 3;
		((System.Windows.Forms.DataGridView)(object)this.dgvUncorrectedICPS).AllowUserToAddRows = false;
		((System.Windows.Forms.DataGridView)(object)this.dgvUncorrectedICPS).AllowUserToDeleteRows = false;
		((System.Windows.Forms.DataGridView)(object)this.dgvUncorrectedICPS).AllowUserToResizeRows = false;
		((System.Windows.Forms.DataGridView)(object)this.dgvUncorrectedICPS).BackgroundColor = System.Drawing.SystemColors.Window;
		dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle15.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle15.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle15.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle15.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle15.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle15.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		((System.Windows.Forms.DataGridView)(object)this.dgvUncorrectedICPS).ColumnHeadersDefaultCellStyle = dataGridViewCellStyle15;
		((System.Windows.Forms.DataGridView)(object)this.dgvUncorrectedICPS).ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
		dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle16.BackColor = System.Drawing.SystemColors.Window;
		dataGridViewCellStyle16.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle16.ForeColor = System.Drawing.SystemColors.ControlText;
		dataGridViewCellStyle16.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle16.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle16.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
		((System.Windows.Forms.DataGridView)(object)this.dgvUncorrectedICPS).DefaultCellStyle = dataGridViewCellStyle16;
		((System.Windows.Forms.Control)(object)this.dgvUncorrectedICPS).Dock = System.Windows.Forms.DockStyle.Fill;
		((System.Windows.Forms.Control)(object)this.dgvUncorrectedICPS).Location = new System.Drawing.Point(0, 0);
		((System.Windows.Forms.Control)(object)this.dgvUncorrectedICPS).Margin = new System.Windows.Forms.Padding(4);
		this.dgvUncorrectedICPS.MergeColumnHeaderBackColor = System.Drawing.SystemColors.Control;
		this.dgvUncorrectedICPS.MergeColumnNames = (System.Collections.Generic.List<string>)resources.GetObject("dgvUncorrectedICPS.MergeColumnNames");
		((System.Windows.Forms.Control)(object)this.dgvUncorrectedICPS).Name = "dgvUncorrectedICPS";
		((System.Windows.Forms.DataGridView)(object)this.dgvUncorrectedICPS).ReadOnly = true;
		((System.Windows.Forms.DataGridView)(object)this.dgvUncorrectedICPS).RowHeadersWidth = 60;
		((System.Windows.Forms.DataGridView)(object)this.dgvUncorrectedICPS).RowTemplate.Height = 23;
		((System.Windows.Forms.Control)(object)this.dgvUncorrectedICPS).Size = new System.Drawing.Size(1080, 312);
		((System.Windows.Forms.Control)(object)this.dgvUncorrectedICPS).TabIndex = 0;
		((System.Windows.Forms.DataGridView)(object)this.dgvUncorrectedICPS).VirtualMode = true;
		((System.Windows.Forms.DataGridView)(object)this.dgvUncorrectedICPS).CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(dgvUncorrectedICPS_CellFormatting);
		((System.Windows.Forms.DataGridView)(object)this.dgvUncorrectedICPS).CellMouseDown += new System.Windows.Forms.DataGridViewCellMouseEventHandler(dgvAnalyteConcentrations_CellMouseDown);
		((System.Windows.Forms.DataGridView)(object)this.dgvUncorrectedICPS).CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(dgvUncorrectedICPS_CellValueNeeded);
		((System.Windows.Forms.DataGridView)(object)this.dgvUncorrectedICPS).DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(dgvAnalyteConcentrations_DataError);
		((System.Windows.Forms.DataGridView)(object)this.dgvUncorrectedICPS).RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(dgvUncorrectedICPS_RowPostPaint);
		((System.Windows.Forms.DataGridView)(object)this.dgvUncorrectedICPS).Scroll += new System.Windows.Forms.ScrollEventHandler(dgvAnalyteConcentrations_Scroll);
		((System.Windows.Forms.DataGridView)(object)this.dgvUncorrectedICPS).SelectionChanged += new System.EventHandler(dgvAnalyteConcentrations_SelectionChanged);
		this.panel3.Controls.Add((System.Windows.Forms.Control)(object)this.rowMergeView1);
		this.panel3.Dock = System.Windows.Forms.DockStyle.Bottom;
		this.panel3.Location = new System.Drawing.Point(4, 316);
		this.panel3.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
		this.panel3.Name = "panel3";
		this.panel3.Size = new System.Drawing.Size(1080, 264);
		this.panel3.TabIndex = 2;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView1).AllowUserToAddRows = false;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView1).AllowUserToDeleteRows = false;
		dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle17.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle17.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle17.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle17.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle17.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle17.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView1).ColumnHeadersDefaultCellStyle = dataGridViewCellStyle17;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView1).ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
		dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle18.BackColor = System.Drawing.SystemColors.Window;
		dataGridViewCellStyle18.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle18.ForeColor = System.Drawing.SystemColors.ControlText;
		dataGridViewCellStyle18.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle18.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle18.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView1).DefaultCellStyle = dataGridViewCellStyle18;
		((System.Windows.Forms.Control)(object)this.rowMergeView1).Dock = System.Windows.Forms.DockStyle.Fill;
		((System.Windows.Forms.Control)(object)this.rowMergeView1).Location = new System.Drawing.Point(0, 0);
		((System.Windows.Forms.Control)(object)this.rowMergeView1).Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
		this.rowMergeView1.MergeColumnHeaderBackColor = System.Drawing.SystemColors.Control;
		this.rowMergeView1.MergeColumnNames = (System.Collections.Generic.List<string>)resources.GetObject("rowMergeView1.MergeColumnNames");
		((System.Windows.Forms.Control)(object)this.rowMergeView1).Name = "rowMergeView1";
		dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle19.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle19.Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle19.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle19.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView1).RowHeadersDefaultCellStyle = dataGridViewCellStyle19;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView1).RowHeadersWidth = 51;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView1).RowTemplate.Height = 27;
		((System.Windows.Forms.Control)(object)this.rowMergeView1).Size = new System.Drawing.Size(1080, 264);
		((System.Windows.Forms.Control)(object)this.rowMergeView1).TabIndex = 2;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView1).VirtualMode = true;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView1).CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(rowMergeView1_CellFormatting);
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView1).CellMouseDown += new System.Windows.Forms.DataGridViewCellMouseEventHandler(dataGridView1_CellMouseDown);
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView1).CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(rowMergeView1_CellValueNeeded);
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView1).DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(dgvAnalyteConcentrations_DataError);
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView1).Scroll += new System.Windows.Forms.ScrollEventHandler(dataGridView1_Scroll);
		this.pageAnalyteICPS.Controls.Add(this.panel6);
		this.pageAnalyteICPS.Controls.Add(this.panel5);
		this.pageAnalyteICPS.Location = new System.Drawing.Point(4, 4);
		this.pageAnalyteICPS.Margin = new System.Windows.Forms.Padding(4);
		this.pageAnalyteICPS.Name = "pageAnalyteICPS";
		this.pageAnalyteICPS.Padding = new System.Windows.Forms.Padding(4);
		this.pageAnalyteICPS.Size = new System.Drawing.Size(1088, 584);
		this.pageAnalyteICPS.TabIndex = 2;
		this.pageAnalyteICPS.Text = "计算强度";
		this.pageAnalyteICPS.UseVisualStyleBackColor = true;
		this.panel6.Controls.Add((System.Windows.Forms.Control)(object)this.dgvAnalyteICPS);
		this.panel6.Dock = System.Windows.Forms.DockStyle.Fill;
		this.panel6.Location = new System.Drawing.Point(4, 4);
		this.panel6.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
		this.panel6.Name = "panel6";
		this.panel6.Size = new System.Drawing.Size(1080, 312);
		this.panel6.TabIndex = 5;
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteICPS).AllowUserToAddRows = false;
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteICPS).AllowUserToDeleteRows = false;
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteICPS).AllowUserToResizeRows = false;
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteICPS).BackgroundColor = System.Drawing.SystemColors.Window;
		dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteICPS).ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteICPS).ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
		dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Window;
		dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.ControlText;
		dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteICPS).DefaultCellStyle = dataGridViewCellStyle3;
		((System.Windows.Forms.Control)(object)this.dgvAnalyteICPS).Dock = System.Windows.Forms.DockStyle.Fill;
		((System.Windows.Forms.Control)(object)this.dgvAnalyteICPS).Location = new System.Drawing.Point(0, 0);
		((System.Windows.Forms.Control)(object)this.dgvAnalyteICPS).Margin = new System.Windows.Forms.Padding(4);
		this.dgvAnalyteICPS.MergeColumnHeaderBackColor = System.Drawing.SystemColors.Control;
		this.dgvAnalyteICPS.MergeColumnNames = (System.Collections.Generic.List<string>)resources.GetObject("dgvAnalyteICPS.MergeColumnNames");
		((System.Windows.Forms.Control)(object)this.dgvAnalyteICPS).Name = "dgvAnalyteICPS";
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteICPS).ReadOnly = true;
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteICPS).RowHeadersWidth = 60;
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteICPS).RowTemplate.Height = 23;
		((System.Windows.Forms.Control)(object)this.dgvAnalyteICPS).Size = new System.Drawing.Size(1080, 312);
		((System.Windows.Forms.Control)(object)this.dgvAnalyteICPS).TabIndex = 0;
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteICPS).VirtualMode = true;
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteICPS).CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(dgvAnalyteICPS_CellFormatting);
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteICPS).CellMouseDown += new System.Windows.Forms.DataGridViewCellMouseEventHandler(dgvAnalyteConcentrations_CellMouseDown);
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteICPS).CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(dgvAnalyteICPS_CellValueNeeded);
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteICPS).DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(dgvAnalyteConcentrations_DataError);
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteICPS).RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(dgvAnalyteICPS_RowPostPaint);
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteICPS).Scroll += new System.Windows.Forms.ScrollEventHandler(dgvAnalyteConcentrations_Scroll);
		((System.Windows.Forms.DataGridView)(object)this.dgvAnalyteICPS).SelectionChanged += new System.EventHandler(dgvAnalyteConcentrations_SelectionChanged);
		this.panel5.Controls.Add((System.Windows.Forms.Control)(object)this.rowMergeView2);
		this.panel5.Dock = System.Windows.Forms.DockStyle.Bottom;
		this.panel5.Location = new System.Drawing.Point(4, 316);
		this.panel5.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
		this.panel5.Name = "panel5";
		this.panel5.Size = new System.Drawing.Size(1080, 264);
		this.panel5.TabIndex = 4;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView2).AllowUserToAddRows = false;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView2).AllowUserToDeleteRows = false;
		dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView2).ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView2).ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
		dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Window;
		dataGridViewCellStyle5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.ControlText;
		dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView2).DefaultCellStyle = dataGridViewCellStyle5;
		((System.Windows.Forms.Control)(object)this.rowMergeView2).Dock = System.Windows.Forms.DockStyle.Fill;
		((System.Windows.Forms.Control)(object)this.rowMergeView2).Location = new System.Drawing.Point(0, 0);
		((System.Windows.Forms.Control)(object)this.rowMergeView2).Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
		this.rowMergeView2.MergeColumnHeaderBackColor = System.Drawing.SystemColors.Control;
		this.rowMergeView2.MergeColumnNames = (System.Collections.Generic.List<string>)resources.GetObject("rowMergeView2.MergeColumnNames");
		((System.Windows.Forms.Control)(object)this.rowMergeView2).Name = "rowMergeView2";
		dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView2).RowHeadersDefaultCellStyle = dataGridViewCellStyle6;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView2).RowHeadersWidth = 51;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView2).RowTemplate.Height = 27;
		((System.Windows.Forms.Control)(object)this.rowMergeView2).Size = new System.Drawing.Size(1080, 264);
		((System.Windows.Forms.Control)(object)this.rowMergeView2).TabIndex = 3;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView2).VirtualMode = true;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView2).CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(rowMergeView2_CellFormatting);
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView2).CellMouseDown += new System.Windows.Forms.DataGridViewCellMouseEventHandler(dataGridView1_CellMouseDown);
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView2).CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(rowMergeView2_CellValueNeeded);
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView2).DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(dgvAnalyteConcentrations_DataError);
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView2).Scroll += new System.Windows.Forms.ScrollEventHandler(dataGridView1_Scroll);
		this.pageRatio.Controls.Add(this.panel8);
		this.pageRatio.Controls.Add(this.panel7);
		this.pageRatio.Location = new System.Drawing.Point(4, 4);
		this.pageRatio.Margin = new System.Windows.Forms.Padding(4);
		this.pageRatio.Name = "pageRatio";
		this.pageRatio.Padding = new System.Windows.Forms.Padding(4);
		this.pageRatio.Size = new System.Drawing.Size(1088, 584);
		this.pageRatio.TabIndex = 3;
		this.pageRatio.Text = "比率";
		this.pageRatio.UseVisualStyleBackColor = true;
		this.panel8.Controls.Add((System.Windows.Forms.Control)(object)this.dgvRatio);
		this.panel8.Dock = System.Windows.Forms.DockStyle.Fill;
		this.panel8.Location = new System.Drawing.Point(4, 4);
		this.panel8.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
		this.panel8.Name = "panel8";
		this.panel8.Size = new System.Drawing.Size(1080, 312);
		this.panel8.TabIndex = 6;
		((System.Windows.Forms.DataGridView)(object)this.dgvRatio).AllowUserToAddRows = false;
		((System.Windows.Forms.DataGridView)(object)this.dgvRatio).AllowUserToDeleteRows = false;
		((System.Windows.Forms.DataGridView)(object)this.dgvRatio).AllowUserToResizeRows = false;
		((System.Windows.Forms.DataGridView)(object)this.dgvRatio).BackgroundColor = System.Drawing.SystemColors.Window;
		dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle7.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle7.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		((System.Windows.Forms.DataGridView)(object)this.dgvRatio).ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7;
		((System.Windows.Forms.DataGridView)(object)this.dgvRatio).ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
		dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Window;
		dataGridViewCellStyle8.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.ControlText;
		dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
		((System.Windows.Forms.DataGridView)(object)this.dgvRatio).DefaultCellStyle = dataGridViewCellStyle8;
		((System.Windows.Forms.Control)(object)this.dgvRatio).Dock = System.Windows.Forms.DockStyle.Fill;
		((System.Windows.Forms.Control)(object)this.dgvRatio).Location = new System.Drawing.Point(0, 0);
		((System.Windows.Forms.Control)(object)this.dgvRatio).Margin = new System.Windows.Forms.Padding(4);
		this.dgvRatio.MergeColumnHeaderBackColor = System.Drawing.SystemColors.Control;
		this.dgvRatio.MergeColumnNames = (System.Collections.Generic.List<string>)resources.GetObject("dgvRatio.MergeColumnNames");
		((System.Windows.Forms.Control)(object)this.dgvRatio).Name = "dgvRatio";
		((System.Windows.Forms.DataGridView)(object)this.dgvRatio).ReadOnly = true;
		((System.Windows.Forms.DataGridView)(object)this.dgvRatio).RowHeadersWidth = 60;
		((System.Windows.Forms.DataGridView)(object)this.dgvRatio).RowTemplate.Height = 23;
		((System.Windows.Forms.Control)(object)this.dgvRatio).Size = new System.Drawing.Size(1080, 312);
		((System.Windows.Forms.Control)(object)this.dgvRatio).TabIndex = 4;
		((System.Windows.Forms.DataGridView)(object)this.dgvRatio).VirtualMode = true;
		((System.Windows.Forms.DataGridView)(object)this.dgvRatio).CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(dgvRatio_CellFormatting);
		((System.Windows.Forms.DataGridView)(object)this.dgvRatio).CellMouseDown += new System.Windows.Forms.DataGridViewCellMouseEventHandler(dgvRatio_CellMouseDown);
		((System.Windows.Forms.DataGridView)(object)this.dgvRatio).CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(dgvRatio_CellValueNeeded);
		((System.Windows.Forms.DataGridView)(object)this.dgvRatio).DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(dgvAnalyteConcentrations_DataError);
		((System.Windows.Forms.DataGridView)(object)this.dgvRatio).SelectionChanged += new System.EventHandler(dgvRatio_SelectionChanged);
		this.panel7.Controls.Add((System.Windows.Forms.Control)(object)this.rowMergeView3);
		this.panel7.Dock = System.Windows.Forms.DockStyle.Bottom;
		this.panel7.Location = new System.Drawing.Point(4, 316);
		this.panel7.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
		this.panel7.Name = "panel7";
		this.panel7.Size = new System.Drawing.Size(1080, 264);
		this.panel7.TabIndex = 5;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView3).AllowUserToAddRows = false;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView3).AllowUserToDeleteRows = false;
		dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle9.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView3).ColumnHeadersDefaultCellStyle = dataGridViewCellStyle9;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView3).ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
		dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle10.BackColor = System.Drawing.SystemColors.Window;
		dataGridViewCellStyle10.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle10.ForeColor = System.Drawing.SystemColors.ControlText;
		dataGridViewCellStyle10.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle10.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView3).DefaultCellStyle = dataGridViewCellStyle10;
		((System.Windows.Forms.Control)(object)this.rowMergeView3).Dock = System.Windows.Forms.DockStyle.Fill;
		((System.Windows.Forms.Control)(object)this.rowMergeView3).Location = new System.Drawing.Point(0, 0);
		((System.Windows.Forms.Control)(object)this.rowMergeView3).Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
		this.rowMergeView3.MergeColumnHeaderBackColor = System.Drawing.SystemColors.Control;
		this.rowMergeView3.MergeColumnNames = (System.Collections.Generic.List<string>)resources.GetObject("rowMergeView3.MergeColumnNames");
		((System.Windows.Forms.Control)(object)this.rowMergeView3).Name = "rowMergeView3";
		dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle11.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle11.Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle11.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle11.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle11.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView3).RowHeadersDefaultCellStyle = dataGridViewCellStyle11;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView3).RowHeadersWidth = 51;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView3).RowTemplate.Height = 27;
		((System.Windows.Forms.Control)(object)this.rowMergeView3).Size = new System.Drawing.Size(1080, 264);
		((System.Windows.Forms.Control)(object)this.rowMergeView3).TabIndex = 4;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView3).VirtualMode = true;
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView3).CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(rowMergeView3_CellFormatting);
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView3).CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(rowMergeView3_CellValueNeeded);
		((System.Windows.Forms.DataGridView)(object)this.rowMergeView3).DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(dgvAnalyteConcentrations_DataError);
		this.toolStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
		this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[6] { this.tsbtnRefresh, this.toolStripSeparator1, this.toolStripButtonExport, this.tsbtnSaveResult, this.tsbtnDatas, this.toolStripComboBoxPA });
		this.toolStrip1.Location = new System.Drawing.Point(0, 0);
		this.toolStrip1.Name = "toolStrip1";
		this.toolStrip1.Size = new System.Drawing.Size(1096, 28);
		this.toolStrip1.TabIndex = 1;
		this.toolStrip1.Text = "toolStrip1";
		this.tsbtnRefresh.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.tsbtnRefresh.Image = ICP_MS.Plugin.Experiment.Properties.Resources.fresh;
		this.tsbtnRefresh.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.tsbtnRefresh.Name = "tsbtnRefresh";
		this.tsbtnRefresh.Size = new System.Drawing.Size(29, 25);
		this.tsbtnRefresh.Text = "刷新";
		this.tsbtnRefresh.Click += new System.EventHandler(tsbtnRefresh_Click);
		this.toolStripSeparator1.Name = "toolStripSeparator1";
		this.toolStripSeparator1.Size = new System.Drawing.Size(6, 28);
		this.toolStripButtonExport.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.toolStripButtonExport.Image = ICP_MS.Plugin.Experiment.Properties.Resources.Save;
		this.toolStripButtonExport.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.toolStripButtonExport.Name = "toolStripButtonExport";
		this.toolStripButtonExport.Size = new System.Drawing.Size(29, 25);
		this.toolStripButtonExport.Text = "导出";
		this.toolStripButtonExport.Click += new System.EventHandler(toolStripButtonExport_Click);
		this.tsbtnSaveResult.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.tsbtnSaveResult.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[3] { this.tsmiCONC, this.tsmiUCPS, this.tsmiCPS });
		this.tsbtnSaveResult.Image = ICP_MS.Plugin.Experiment.Properties.Resources.Save;
		this.tsbtnSaveResult.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.tsbtnSaveResult.Name = "tsbtnSaveResult";
		this.tsbtnSaveResult.Size = new System.Drawing.Size(39, 25);
		this.tsbtnSaveResult.Text = "保存结果";
		this.tsbtnSaveResult.Visible = false;
		this.tsbtnSaveResult.ButtonClick += new System.EventHandler(tsbtnSaveResult_ButtonClick);
		this.tsmiCONC.Name = "tsmiCONC";
		this.tsmiCONC.Size = new System.Drawing.Size(152, 26);
		this.tsmiCONC.Text = "浓度";
		this.tsmiCONC.Click += new System.EventHandler(tsmiCONC_Click);
		this.tsmiUCPS.Name = "tsmiUCPS";
		this.tsmiUCPS.Size = new System.Drawing.Size(152, 26);
		this.tsmiUCPS.Text = "原始强度";
		this.tsmiUCPS.Click += new System.EventHandler(tsmiUCPS_Click);
		this.tsmiCPS.Name = "tsmiCPS";
		this.tsmiCPS.Size = new System.Drawing.Size(152, 26);
		this.tsmiCPS.Text = "校正强度";
		this.tsmiCPS.Click += new System.EventHandler(tsmiCPS_Click);
		this.tsbtnDatas.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.tsbtnDatas.Image = ICP_MS.Plugin.Experiment.Properties.Resources.Edit;
		this.tsbtnDatas.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.tsbtnDatas.Name = "tsbtnDatas";
		this.tsbtnDatas.Size = new System.Drawing.Size(29, 25);
		this.tsbtnDatas.Text = "设置显示数据";
		this.tsbtnDatas.Click += new System.EventHandler(tsbtnDatas_Click);
		this.toolStripComboBoxPA.Items.AddRange(new object[3] { "使用PA校正", "只用PC值", "只用Analog值" });
		this.toolStripComboBoxPA.Name = "toolStripComboBoxPA";
		this.toolStripComboBoxPA.Size = new System.Drawing.Size(200, 28);
		this.toolStripComboBoxPA.Text = "使用PA校正";
		this.toolStripComboBoxPA.SelectedIndexChanged += new System.EventHandler(toolStripComboBoxPA_SelectedIndexChanged);
		this.dataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
		this.dataGridViewTextBoxColumn1.DataPropertyName = "sample";
		this.dataGridViewTextBoxColumn1.Frozen = true;
		this.dataGridViewTextBoxColumn1.HeaderText = "样品名称/分析时间";
		this.dataGridViewTextBoxColumn1.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
		this.dataGridViewTextBoxColumn1.ReadOnly = true;
		this.dataGridViewTextBoxColumn1.Width = 160;
		this.dataGridViewTextBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
		this.dataGridViewTextBoxColumn2.DataPropertyName = "sample";
		this.dataGridViewTextBoxColumn2.Frozen = true;
		this.dataGridViewTextBoxColumn2.HeaderText = "样品名称/分析时间";
		this.dataGridViewTextBoxColumn2.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
		this.dataGridViewTextBoxColumn2.ReadOnly = true;
		this.dataGridViewTextBoxColumn2.Width = 160;
		this.dataGridViewTextBoxColumn3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
		this.dataGridViewTextBoxColumn3.DataPropertyName = "sample";
		this.dataGridViewTextBoxColumn3.Frozen = true;
		this.dataGridViewTextBoxColumn3.HeaderText = "样品名称/分析时间";
		this.dataGridViewTextBoxColumn3.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
		this.dataGridViewTextBoxColumn3.ReadOnly = true;
		this.dataGridViewTextBoxColumn3.Width = 160;
		this.dataGridViewTextBoxColumn4.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
		this.dataGridViewTextBoxColumn4.DataPropertyName = "sample";
		this.dataGridViewTextBoxColumn4.HeaderText = "样品名称/分析时间";
		this.dataGridViewTextBoxColumn4.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
		this.dataGridViewTextBoxColumn4.ReadOnly = true;
		this.dataGridViewTextBoxColumn4.Width = 160;
		base.AutoScaleDimensions = new System.Drawing.SizeF(8f, 15f);
		base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
		base.ClientSize = new System.Drawing.Size(1096, 641);
		base.Controls.Add(this.tabNumeric);
		base.Controls.Add(this.toolStrip1);
		base.Margin = new System.Windows.Forms.Padding(4);
		base.Name = "FormNumerics";
		base.ShowIcon = false;
		this.Text = "FormNumerics";
		base.FormClosing += new System.Windows.Forms.FormClosingEventHandler(FormNumerics_FormClosing);
		base.Load += new System.EventHandler(FormNumerics_Load);
		this.tabNumeric.ResumeLayout(false);
		this.pageAnalyteConcentration.ResumeLayout(false);
		this.panel2.ResumeLayout(false);
		((System.ComponentModel.ISupportInitialize)this.dgvAnalyteConcentrations).EndInit();
		this.panel1.ResumeLayout(false);
		((System.ComponentModel.ISupportInitialize)this.dataGridView1).EndInit();
		this.pageUncorrectICPS.ResumeLayout(false);
		this.panel4.ResumeLayout(false);
		((System.ComponentModel.ISupportInitialize)this.dgvUncorrectedICPS).EndInit();
		this.panel3.ResumeLayout(false);
		((System.ComponentModel.ISupportInitialize)this.rowMergeView1).EndInit();
		this.pageAnalyteICPS.ResumeLayout(false);
		this.panel6.ResumeLayout(false);
		((System.ComponentModel.ISupportInitialize)this.dgvAnalyteICPS).EndInit();
		this.panel5.ResumeLayout(false);
		((System.ComponentModel.ISupportInitialize)this.rowMergeView2).EndInit();
		this.pageRatio.ResumeLayout(false);
		this.panel8.ResumeLayout(false);
		((System.ComponentModel.ISupportInitialize)this.dgvRatio).EndInit();
		this.panel7.ResumeLayout(false);
		((System.ComponentModel.ISupportInitialize)this.rowMergeView3).EndInit();
		this.toolStrip1.ResumeLayout(false);
		this.toolStrip1.PerformLayout();
		base.ResumeLayout(false);
		base.PerformLayout();
	}
}
